dsstlsqt696435 2014-10-24 11:34
浏览 183
已采纳

Beanstalkd“延迟工作”不执行

I'm having some issues getting a job to run in my Laravel 4 setup. I have it working on Homestead, however it doesn't work on production. I'm using Beanstalkd (with pheanstalk), and Supervisor, following this tutorial.

In a nutshell, I want to delete an image which is on my server, 20 seconds after the job has been called.

Queue::later(20, 'App\Queues\FileHandler@delete', ['file' => $file]);

$file is the path to my file.

My delete method:

public function delete($job, $data)
{
    var_dump($data);
    if (File::exists($data['file']))
        File::delete($data['file']);

    $job->delete();
}

I also installed Beanstalkd Console.

Right, so when I click the button, it triggers the queue. I can see on the console the console that it now has the correct $data, with the correct path to the file.

On the console, the time-left counts down from 20... and when it hits 0, it resets to a very large number (18446744073666). There is no errors/output in the logs.

As soon as I "kick" the job from the console, it executes and my file deletes, so I know the code is sound.

Anyone got any suggestions, its really annoying me :(

  • 写回答

1条回答 默认 最新

  • doucezhu3570 2014-10-24 11:40
    关注

    Version 1.4.6 had an issue with delayed jobs. Upgrade to 1.5 or 1.6 if your running on 1.4.6

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容