Reputation: 20415
I have a pending transaction between two Accounts, and after a preset date, if nothing happens, then the transaction should be automatically expired. (I need this expiration to happen in real time, and not when one of the users login to their account).
What would be the best way to create a timer to check against transactions and set their status in near time?
Thank you.
Upvotes: 3
Views: 319
Reputation: 32943
Use a rake task triggered with a cron job, as Abe Petrillo suggests. There is overhead as rake must load up the rails env each time, but if this happens based on date then i guess you just need to run it once a day, in which case the overhead isn't significant.
That cron-in-ruby thing looks kind of overengineered to me.
Upvotes: 1