Skip to content

Commit

Permalink
chore(mw-jobs): temporarily return early from job
Browse files Browse the repository at this point in the history
  • Loading branch information
m90 committed Jun 19, 2023
1 parent bfbe1d1 commit 0e4d66d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# api

## 8x.12.3 - 19 June 2023
- Temporary fix: make polling job a no-op so the queue can empty
- Run polling job less often

## 8x.12.2 - 13 June 2023
Expand Down
13 changes: 8 additions & 5 deletions app/Jobs/PollForMediaWikiJobsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ class PollForMediaWikiJobsJob extends Job implements ShouldQueue, ShouldBeUnique
public $timeout = 3600;
public function handle (): void
{
$allWikiDomains = Wiki::all()->pluck('domain');
foreach ($allWikiDomains as $wikiDomain) {
if ($this->hasPendingJobs($wikiDomain)) {
$this->enqueueWiki($wikiDomain);
return;
/*
$allWikiDomains = Wiki::all()->pluck('domain');
foreach ($allWikiDomains as $wikiDomain) {
if ($this->hasPendingJobs($wikiDomain)) {
$this->enqueueWiki($wikiDomain);
}
}
}
*/
}

private function hasPendingJobs (string $wikiDomain): bool
Expand Down

0 comments on commit 0e4d66d

Please sign in to comment.