Skip to content

Commit bc22037

Browse files
committed
fix: issue with job pause management
1 parent cd11eba commit bc22037

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/bundle/Resources/translations/import_export.en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Notice: Notice
22
job.breadcrumb.list: Jobs
33
job.cancel: Cancel
4+
job.pause: Pause
45
job.create.success: 'Job ''%label%'' created.'
56
job.creating: Creating
67
job.list.action.create: Create

src/bundle/Resources/translations/import_export.fr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Notice: Notice
22
job.breadcrumb.list: Tâches
33
job.cancel: Annuler
4+
job.pause: Mettre en pause
45
job.create.success: 'Tâche ''%label%'' créée.'
56
job.creating: Création
67
job.list.action.create: Créer

src/lib/Job/AbstractJobRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __invoke(Job $job, int $batchLimit = -1, bool $reset = false): i
2323
$job->reset();
2424
}
2525

26-
if (!$job->isPending()) {
26+
if (!$job->canRun()) {
2727
return $job->getStatus();
2828
}
2929

src/lib/Job/Job.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ public function isPaused(): bool
313313
return in_array($this->status, [self::STATUS_PAUSED, self::STATUS_FORCE_PAUSED]);
314314
}
315315

316-
public function isPending(): bool
316+
public function canRun(): bool
317317
{
318-
return self::STATUS_PENDING === $this->status || $this->isPaused();
318+
return in_array($this->status, [self::STATUS_PENDING, self::STATUS_QUEUED]) || $this->isPaused();
319319
}
320320
}

0 commit comments

Comments
 (0)