Home > Backend Development > PHP Tutorial > Why does the scheduled task function of discuz not use event scheduling?

Why does the scheduled task function of discuz not use event scheduling?

WBOY
Release: 2016-07-06 13:53:56
Original
991 people have browsed it

Why does the scheduled task function of discuz not use event scheduling?

I observed the database at the specified time and found that the specified data had not changed, that is, the planned task was not executed. I heard that it was executed only after opening the page, and I was convinced. Why doesn't this team use event scheduling?

Reply content:

Why does the scheduled task function of discuz not use event scheduling?

I observed the database at the specified time and found that the specified data had not changed, that is, the planned task was not executed. I heard that it was executed only after opening the page, and I was convinced. Why doesn't this team use event scheduling?

You have two questions:

  1. Discuz did not execute the scheduled task

  2. Discuz’s development team does not use event scheduling

First question, it should be said that if your website does not have any user access, it may not be executed. After all, Discuz’s scheduled tasks are triggered. As for how to solve it, it is recommended to look for posts like this. It may be caused by upgrading or installing plug-ins.

The second question should be determined by the design idea of ​​Discuz. I guess its design idea is to use the most basic php and mysql to complete the main functions, so event scheduling was not considered during the design.

Because he has to consider the space used by the user

Virtual hosts do not have crontab permissions, and technology has always been weighed under restrictions.
I think this function may be:
Write the configuration to a randomly named file, and then PHP ignores the user's shutdown, and the infinite loop runs until the point is executed. If it is found that the configuration file does not exist, it will exit.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template