Symfony delete record after set time
I am making a sort of session table that adds a new record to a table when a user acce开发者_运维百科sses a particular form.
My question is is there any way of deleting a record after a certain amount of time after it was created? For example if the record was last updated at 10:00, it would be deleted at 11:00.
The only way to achieve this is to create a cron job. Create the cron job that runs a symfony task that deletes records that are greater than 12hrs old. Then set the cron to run every hour.
精彩评论