diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b01eaa16..e1a9266ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # api +## 10x.1.2 - 25 March 2024 +- Define default job timeout at class level + ## 10x.1.1 - 14 March 2024 - Declare Horizon configuration stubs for all known environments diff --git a/app/Jobs/Job.php b/app/Jobs/Job.php index caedb914d..1969c9930 100644 --- a/app/Jobs/Job.php +++ b/app/Jobs/Job.php @@ -22,6 +22,8 @@ abstract class Job implements ShouldQueue */ use InteractsWithQueue, Queueable, SerializesModels; + public $timeout = 60; + public function backoff(): array { return Config::get('queue.backoff'); diff --git a/app/Jobs/PollForMediaWikiJobsJob.php b/app/Jobs/PollForMediaWikiJobsJob.php index cfe2a798c..1a0a8543d 100644 --- a/app/Jobs/PollForMediaWikiJobsJob.php +++ b/app/Jobs/PollForMediaWikiJobsJob.php @@ -10,7 +10,7 @@ class PollForMediaWikiJobsJob extends Job implements ShouldQueue, ShouldBeUnique { - public $timeout = 3600; + public $timeout = 1800; public function handle (): void { $allWikiDomains = Wiki::all()->pluck('domain'); diff --git a/config/horizon.php b/config/horizon.php index 618e7b9db..b439c11ad 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -191,7 +191,7 @@ 'coolDown' => intval(env('HORIZON_COOL_DOWN', 3)), 'memory' => intval(env('HORIZON_MEMORY', 128)), 'tries' => intval(env('HORIZON_TRIES', 1)), - 'timeout' => intval(env('HORIZON_TIMEOUT', 60)), + 'timeout' => intval(env('HORIZON_TIMEOUT', 3600)), ], ], 'environments' => [