I am building a simple auction application. I need auctions to start and end at certain times. Should the page that displays the open auctions just run a query to find all auctions where current time is after the start time and before the end time? Or would it bet better to have a script that sets a “active” column to True? If this is the case would I have to have some type of cronjob setup?
Share
No cron and no “active” column is required. Just list auctions using something like:
When user is placing a bid use the following:
Then check if query has affected a row. If yes – bid is successful, current user is highest bidder. If no – bid is too low or auction has finished. You can figure out that later by fetching auction row again and checking bidder id.