开发者

Symfony delete record after set time

开发者 https://www.devze.com 2023-02-20 02:08 出处:网络
I am making a sort of session table that adds a new record to a table when a user acce开发者_运维百科sses a particular form.

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

精彩评论

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