【发布时间】:2017-07-23 17:59:00
【问题描述】:
我有这样的工作:
//Run very intensive script that generates files
//Notify the user that the job is done
我知道脚本需要 4-5 分钟才能运行,因为这是生成所有文件所需的时间。 但是,正好在 60 秒后,该作业被删除(即,我在我的 jobs 数据库表中没有看到它)并且用户会收到通知。然后,每隔 60 秒,在脚本完成之前,用户会收到通知作业已完成。
作业不会失败。该作业仅在前 60 秒内出现在 jobs 表中。文件生成脚本只运行一次。
我使用主管:
[program:queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:work --timeout=600 --queue=high,low
user=forge
numprocs=8
directory=/home/forge/default
stdout_logfile=/home/forge/default/storage/logs/supervisor.log
redirect_stderr=true
这是我的数据库配置:
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'low',
'expire' => 600,
],
如果我使用redis,行为是一样的
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => 'low',
'expire' => 600,
],
【问题讨论】: