I have tried installing this on two different test websites and have run across the same situation both times. It appears that the initial run of cron is causing some issues with the ad auctions.
The auction expiration date on the first set of ad_slots is being set to December 31st, 1969 (a timestamp of 0). After some investigation it appears that the initial entries in the ad_auction table contain records with a "cid" of 0. This leads me to believe that the ad_auction_cycles records were not created before the original ad_slot nodes.
What appears to have happened is that the code looks to grab the cid from the ad_auctions_cycles table but the first time it runs under cron it is not pulling back a correct "cid". This is causing the entry into the ad_auction table to have a "cid" value of 0, which causes the "expiry" column in the uc_auction table to be set to 0.
This is not a major deal as it seems to correct itself on subsequent cron runs but seems to be a bug in how the initial cron run is handled. Let me know if you need any more information.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ad_auction_current_bid_cycle.patch | 1 KB | codekarate |
Comments
Comment #1
NewZeal commentedThanks for the feedback. I will test the module on a few clean installs and find a solution. As you can imagine once I started developing the module I missed bugs like this.
Comment #2
codekarate commentedAfter the first full ad cycle I noticed that this error started popping back up. In fact because the expiration date of the auction was set to a datestamp of 0 there were no auctions showing up for the advertisements. Every subsequent cron run new ad_slot nodes were being created. After over 800 new nodes were created I had to turn the module off.
After some further research I noticed that the ad_cycle table does not look like it has been marking the new cycles as "started" and I still notice a "cid" value of 0 for all the new entries in the ad_auction table.
Let me know if you have any ideas on what might be happening. I will do some more research and see if I can figure out the cause as well.
Comment #3
codekarate commentedHas any progress been made on determining the cause of this? I am finally going to have some time in the next few weeks to take a look at this but I just wanted to make sure I am not duplicating efforts if you have already found the issue.
Comment #4
codekarate commentedFixed by changing the following code from
To:
All I did was add the "=" to the "auction_start<%d". The problem was occurring because when cron ran the first time it was not catching the correct ad_auction_cycle becuase the auction_start was created the same second that the select query was run. I believe this will also fix my re-occurring error that was causing so many ad_slots to be created but I will need to test and verify that.
Comment #5
codekarate commentedHere is the patch for the fix.
Comment #6
NewZeal commentedThanks for the patch. Now included in the code and committed to HEAD. Just which I knew how to get issues posted against my projects to appear in my mailbox. Subscribing to the project doesn't seem to do it.