Skip to content

Releases: hyperf/xxl-job-incubator

Release v0.4.2

05 Mar 01:13
9da34e1
Compare
Choose a tag to compare
bug fix: swoole 环境下使用 process 进程模式无法执行超过 60 秒的耗时定时任务 (#13)

* bug fix: swoole 环境下使用 process 进程模式无法执行超过 60 秒的耗时定时任务

【问题】:xxl-job-incubator 在 swoole 环境下默认使用 process 进程模式执行定时任务,其使用 Symfony Process 类创建进程,Process 类的构建函数的最后一个参数 timeout 超时时间默认写死为 60 秒,xxl-job-incubator 在使用 new Process($command) 构建进程时使用了默认的 timeout,当定时任务执行时间超过 60 秒时,进程自动退出,导致定时任务无法执行完成。

【解决】:将在 xxl-job-admin 管理后台配置的”任务超时时间“传递给 Process 类的 timeout 参数,若”任务超时时间“为0,即永不超时,则传 null 给 timeout,表示禁用超时功能。

【参考】:Symfony Process 构建函数:
// $timeout The timeout in seconds or null to disable
public function __construct(array $command, string $cwd = null, array $env = null, mixed $input = null, ?float $timeout = 60))

* Optimized code

---------

Co-authored-by: 李铭昕 <[email protected]>

Release v0.4.1

05 Feb 06:34
Compare
Choose a tag to compare
composer add symfony/process

Release v0.4.0

05 Feb 05:31
Compare
Choose a tag to compare
Remove excess code

Release v0.3.4

22 Jan 08:30
Compare
Choose a tag to compare
自动获取PHP_BINARY

Release v0.3.3

04 Dec 05:45
Compare
Choose a tag to compare
adaptation 3.1

Release v0.3.2

01 Dec 02:05
Compare
Choose a tag to compare
set ProcessTitle

Release v0.3.1

26 Sep 08:57
Compare
Choose a tag to compare
support log_retention_days

Release v0.3.0

21 Sep 06:00
Compare
Choose a tag to compare
update composer.

Release v0.2.0

29 Mar 05:51
Compare
Choose a tag to compare

Release v0.1.4

09 Jan 09:21
Compare
Choose a tag to compare
Optimization kill