gpt4 book ai didi

magento - 时间太晚了

转载 作者:行者123 更新时间:2023-12-04 03:08:08 25 4
gpt4 key购买 nike

当带有“newsletter_send_all”的 Cron 执行此作业代码时,其状态变为未接并传递如下消息。当前使用 magento 的默认 cron 设置和 UTC 时间。我的 Cron.php 每 5 分钟执行一次。请帮我解决这个古玩问题。

    exception 'Mage_Core_Exception' with message 'Too late for the schedule' in /home/test/public_html/app/Mage.php:595
Stack trace:
#0 /home/test/public_html/app/code/core/Mage/Cron/Model/Observer.php(293): Mage::throwException('Too late for th...')
#1 /home/test/public_html/app/code/core/Mage/Cron/Model/Observer.php(72): Mage_Cron_Model_Observer->_processJob(Object(Mage_Cron_Model_Schedule), Object(Mage_Core_Model_Config_Element))
#2 /home/test/public_html/app/code/core/Mage/Core/Model/App.php(1338): Mage_Cron_Model_Observer->dispatch(Object(Varien_Event_Observer))
#3 /home/test/public_html/app/code/core/Mage/Core/Model/App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Cron_Model_Observer), 'dispatch', Object(Varien_Event_Observer))
#4 /home/test/public_html/app/Mage.php(448): Mage_Core_Model_App->dispatchEvent('default', Array)
#5 /home/test/public_html/cron.php(75): Mage::dispatchEvent('default')
#6 {main}

出于测试目的,还在 newslatter 模块的核心观察器中进行了以下修改,但仍然无法正常工作

    public function scheduledSend($schedule)
{
$countOfQueue = 1; // default 3 Modified on 14 Nov 17
$countOfSubscritions = 1; //default 20 Modified on 14 Nov 17

$collection = Mage::getModel('newsletter/queue')->getCollection()
->setPageSize($countOfQueue)
->setCurPage(1)
->addOnlyForSendingFilter()
->load();

$collection->walk('sendPerSubscriber', array($countOfSubscritions));
}

最佳答案

This happens when the scheduler finds pending jobs that were supposed to be scheduled longer than the time configured in 'system/cron/schedule_lifetime'. By default this value is set to 15 minutes.

There are two different problems the may result in you seeing this error:

  1. Cron isn't configured to run often enough: If you don't trigger cron often enough then the tasks start piling up and most likely tasks will be too late for schedule at the point when they're being executed by the scheduler. Instead of increasing the scheduler_lifetime settings you should increase the frequency cron is being called to */5 * * * * (every 5 minutes) or even * * * * * (every minute).
  2. You have long running cron jobs that will block the execution of other jobs: In case you're importing data, indexing products, generating reports or doing other long-running jobs via cron (which is generally a good idea) other jobs will not be run in parallel (unless you're running cron.php instead of cron.sh). This will result in these jobs not being executed. Find out which jobs are preventing others from running (by looking at the timeline view) and run them in a different cron group. (look at this for more information and check the features added to version >0.5.0 for an easier way to configure and manage cron groups.

来源https://github.com/AOEpeople/Aoe_Scheduler/blob/master/doc/faq.md

关于magento - 时间太晚了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47287192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com