【问题标题】:Laravel Horizon -- 1 Worker processes more than 1 job at a timeLaravel Horizo​​​​n - 1 Worker 一次处理超过 1 个作业
【发布时间】:2020-10-19 10:16:11
【问题描述】:

我有一个维护单个进程的 Laravel Horizo​​n 主管配置。但是,我不能让这个过程一次只运行一项工作。这个配置

'long-running-supervisor' => [
       'connection' => 'redis-long-running',
       'queue' => ['default_long'],
       'balance' => 'simple',
       'processes' => 1,
       'tries' => 1,
       'timeout' => 720
 ],

但是,这个 default_long 进程同时重叠作业,而不是等待一个完成后再开始另一个。

地平线输出(为简洁而编辑)

WaistPredictionJob 8039
Queue: default_long | Tags: App\Prediction:620  2020-10-17 19:49:45     29.20s  

WaistPredictionJob 8049
Queue: default_long | Tags: App\Prediction:621  2020-10-17 19:50:11     29.08s

PredictionCompleted 8051
Queue: default | Tags: App\Prediction:620   2020-10-17 19:50:16     0.03s

WaistPredictionJob 8054
Queue: default_long | Tags: App\Prediction:622  2020-10-17 19:50:17     25.77s  

PredictionCompleted 8064
Queue: default | Tags: App\Prediction:621   2020-10-17 19:50:46     0.16s

PredictionCompleted 8074
Queue: default | Tags: App\Prediction:622   2020-10-17 19:51:11     0.03s

【问题讨论】:

    标签: laravel queue horizon


    【解决方案1】:

    我想通了。

    我错误地认为时间戳是作业完成的时间,而实际上它们代表作业的排队时间。

    如果您查看PredictionCompleted 作业的时间戳,您会注意到WaistPrediciton 作业实际上是一个接一个地运行。

    【讨论】:

      猜你喜欢
      • 2021-10-27
      • 2019-05-12
      • 1970-01-01
      • 2018-05-29
      • 1970-01-01
      • 2018-05-30
      • 1970-01-01
      • 2021-05-01
      • 2016-09-13
      相关资源
      最近更新 更多