How do you implement a cron job logic in web applications?

时间:2015-05-04 19:35:08

标签: php linux web-services cron

In our web application, we need to implement a business logic like: An order's status will be changed from "Submitted" to "Expired" after two weeks, if the seller does not take any action.

We are using php5+apache+mysql+linux. To implement this logic, we need something like a linux crontab task that is scheduled to run two weeks later when the order is submitted. The task is to trivially check whether there is action recorded in the database. If not, then update the status string in the database.

Is there some service like this in Apache or linux? What is an elegant way to implement this logic?

Thanks.

1 个答案:

答案 0 :(得分:0)

只有一个Cron作业,即执行php脚本...
这个cron每天都会运行,以检查和更新数据库中的状态

相关问题