8

I have a scheduled task set up in the sitecore content editor that is set to run ever 5 minutes. 20100901T235900|20200101T235900|127|00:05:00 The frequency I have set up in the web.config is check every minute.

<frequency>00:01:00</frequency>
<agent type="Sitecore.Tasks.DatabaseAgent" method="Run" interval="00:01:00">
<param desc="database">master</param>
<param desc="schedule root">/sitecore/system/tasks/schedules</param>
<LogActivity>true</LogActivity>
</agent> 

The problem seems to be that the last run time keeps updating every 5 minutes regardless of whether or not sitecore has checked to see if its due or not. So the time keeps updating and then sitecore checks to see if its due and alway says "not due" and never runs. I have confirmed that the Sitecore server and DB server system times are in sync. Does anyone know why the last run time would update even though sitecore has not run the task? As a troubleshooting note. If I watch the logs and note i.e. that the last time it checked to see if it was due was 12:00:15. Then I go into the content editor and change the last run time to "an hour ago" or "a day ago" and wait until just before 12:05:15 to save the change. Then the task scheduler has not had time to update the last run time and sitecore picks up the task and runs it. I can see it in the logs. It will then run about 4 or 5 more times on the 5 minute mark but then reverts back to the same issue. I have to think it is because eventually sitecore no longer checks on the 15 second mark and there ends up being too big of a time interval between the two.

Any help would be greatly appreciated. Thanks.

4

1 回答 1

10

您是否有超过 1 个 Web 应用程序实例连接到同一个数据库?

例如,超过 1 个开发人员使用相同的数据库。也许有些任务是在另一台机器上执行的,而不是在你的机器上?

这是发生此类问题的最常见情况。请记住,Sitecore将有关任务执行的信息存储在数据库中,如果您有多个 Web 应用程序使用同一个数据库,则只有其中一个(并且每次随机)会执行任务。

于 2013-11-08T07:56:43.327 回答