Skip to content

Commit a42a12d

Browse files
authored
chore(mw-jobs): reenable polling job (#612)
1 parent 7952fae commit a42a12d

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

CHANGELOG.md

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

3+
## 8x.12.4 - 19 June 2023
4+
- Reenable work done in polling job
5+
36
## 8x.12.3 - 19 June 2023
47
- Temporary fix: make polling job a no-op so the queue can empty
58
- Run polling job less often

app/Jobs/PollForMediaWikiJobsJob.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ class PollForMediaWikiJobsJob extends Job implements ShouldQueue, ShouldBeUnique
1313
public $timeout = 3600;
1414
public function handle (): void
1515
{
16-
return;
17-
/*
18-
$allWikiDomains = Wiki::all()->pluck('domain');
19-
foreach ($allWikiDomains as $wikiDomain) {
20-
if ($this->hasPendingJobs($wikiDomain)) {
21-
$this->enqueueWiki($wikiDomain);
22-
}
16+
$allWikiDomains = Wiki::all()->pluck('domain');
17+
foreach ($allWikiDomains as $wikiDomain) {
18+
if ($this->hasPendingJobs($wikiDomain)) {
19+
$this->enqueueWiki($wikiDomain);
2320
}
24-
*/
21+
}
2522
}
2623

2724
private function hasPendingJobs (string $wikiDomain): bool

tests/Jobs/PollForMediaWikiJobsJobTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public function setUp(): void
2727

2828
public function testNoJobs()
2929
{
30-
$this->markTestSkipped();
3130
Http::fake([
3231
getenv('PLATFORM_MW_BACKEND_HOST').'/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=json' => Http::response([
3332
'query' => [
@@ -51,7 +50,6 @@ public function testNoJobs()
5150

5251
public function testWithJobs()
5352
{
54-
$this->markTestSkipped();
5553
Http::fake([
5654
getenv('PLATFORM_MW_BACKEND_HOST').'/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=json' => Http::response([
5755
'query' => [
@@ -76,7 +74,6 @@ public function testWithJobs()
7674

7775
public function testWithFailure()
7876
{
79-
$this->markTestSkipped();
8077
Http::fake([
8178
getenv('PLATFORM_MW_BACKEND_HOST').'/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=json' => Http::response([
8279
'error' => 'Something went wrong'

0 commit comments

Comments
 (0)