I have a database which, after 30 minutes from the rows updated_at time, I want to delete rows from the database. I know how to find rows based on this time, but I don’t know a technique for actually deleting it on a timed interval.
What is a good method of achieving this? Is there something Rails-esque?
Delayed Job is a common tool for this sort of thing.
You could make a simple class with a
performmethod to delete the entry:And then, when you decide that your object should be deleted, queue up your delayed task: