Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions app/Jobs/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/PollForMediaWikiJobsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class PollForMediaWikiJobsJob extends Job implements ShouldQueue, ShouldBeUnique
{
public $timeout = 3600;
public $timeout = 1800;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this takes something around 3 to 7 minutes in production (depending on current load), so I think it's fine to lower this while we're at it.

public function handle (): void
{
$allWikiDomains = Wiki::all()->pluck('domain');
Expand Down
2 changes: 1 addition & 1 deletion config/horizon.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down