Cron不会再跑了

时间:2015-12-22 19:19:21

标签: php magento cron

我在Magento上有Aoe Scheduler并注意到"系统备份"仍在运行近一天。我尝试使用Aoe Scheduler中的kill选项杀死进程并在我的日志文件中获取:

2015-12-22T18:33:31+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:34:02+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:34:02+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:34:32+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:34:32+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 467
2015-12-22T18:35:03+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453
2015-12-22T18:35:03+00:00 ERR (3): Warning: posix_kill() expects parameter 2 to be long, string given  in /home/angeecom/public_html/app/code/community/Aoe/Scheduler/Model/Schedule.php on line 453

Schedule.php文件包含:

    // let's be nice first (a.k.a. "Could you please stop running now?")
    if (posix_kill($this->getPid(), SIGINT)) {
        $this->log(sprintf('Sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
    } else {
        $this->log(sprintf('Error while sending SIGINT to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
    }

    // check if process terminates within 30 seconds
    $startTime = time();
    while (($waitTime = (time() - $startTime) < 30) && $this->checkPid()) {
        sleep(2);
    }

    if ($this->checkPid()) {
        // What, you're still alive? OK, time to say goodbye now. You had your chance...
        if (posix_kill($this->getPid(), SIGKILL)) {
            $this->log(sprintf('Sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()));
        } else {
            $this->log(sprintf('Error while sending SIGKILL to job "%s" (id: %s)', $this->getJobCode(), $this->getId()), Zend_Log::ERR);
        }
    } else {
        $this->log(sprintf('Killed job "%s" (id: %s) with SIGINT. Job terminated after %s second(s)', $this->getJobCode(), $this->getId(), $waitTime));
    }

杀人不起作用,但我不明白为什么cron仍然在第一时间运行!

1 个答案:

答案 0 :(得分:0)

回答可能有点迟,但我遇到了和你一样的问题。

经过一段时间的挫折之后,我去了Connect Manager并卸载了扩展程序,清理了所有缓存,登出并重新安装了它。 这对我来说就是诀窍,它现在正在运行。

我担心我不知道它有什么问题,只是这对我有用。