开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜