Skip to content

Commit b787cb9

Browse files
authored
fix: horizon supervisor does not consider job level timeouts (#771)
1 parent 96f85e7 commit b787cb9

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# api
22

3+
## 10x.1.2 - 25 March 2024
4+
- Define default job timeout at class level
5+
36
## 10x.1.1 - 14 March 2024
47
- Declare Horizon configuration stubs for all known environments
58

app/Jobs/Job.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ abstract class Job implements ShouldQueue
2222
*/
2323
use InteractsWithQueue, Queueable, SerializesModels;
2424

25+
public $timeout = 60;
26+
2527
public function backoff(): array
2628
{
2729
return Config::get('queue.backoff');

app/Jobs/PollForMediaWikiJobsJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class PollForMediaWikiJobsJob extends Job implements ShouldQueue, ShouldBeUnique
1212
{
13-
public $timeout = 3600;
13+
public $timeout = 1800;
1414
public function handle (): void
1515
{
1616
$allWikiDomains = Wiki::all()->pluck('domain');

config/horizon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
'coolDown' => intval(env('HORIZON_COOL_DOWN', 3)),
192192
'memory' => intval(env('HORIZON_MEMORY', 128)),
193193
'tries' => intval(env('HORIZON_TRIES', 1)),
194-
'timeout' => intval(env('HORIZON_TIMEOUT', 60)),
194+
'timeout' => intval(env('HORIZON_TIMEOUT', 3600)),
195195
],
196196
],
197197
'environments' => [

0 commit comments

Comments
 (0)