[eluser]Unknown[/eluser]
Hello,
I am developing an auction application, e.g. like ebay.
Now I've the following problem:
If an auction for a given product ends, the status of the auction has to be changed to expired. As far as I know there in no possibility to run a scheduled task with php (eg. run task on 26th of March 2010 at 12:04:01 pm).
The only way it works (that I know) is to create a cron. There are two solutions I'm thinking about.
First one:
With every auction I create a new cron, which runs once. Therefore I start a script, which would be like "www.domain.tld/auction/check_expired/auction_id" where "auction" a controller represents and "check_expired" a function and the "auction_id" the parameter (surprise surprise) id of the auction.
The second one:
I've just one cron job, which runs every minute and checks all auctions, whether they are expired or not. The benefit is, that I've just one cron that runs more often.
For me the first option sounds better, since I've not so much experience with the effects of crons on the performance I don't know, if the second option wouldn't be better.
Does somebody has experience with such problems, or maybe even knows a third option, how to solve the problem.
I am thankful for every advice!