Fix bug when changing ScheduledTask in_progress field

In 3394568, SendingQueue::stopProgress() was refactored to use Doctrine
but a typo introduced a bug causing this method to set
ScheduledTaskEntity::inProgress to true instead of false:

3394568792 (diff-3a26b2d8faf9cc01efd5aef47b058c088c0de01b8074c3be7cefd9adb77fbaaaR551)

This luckly was caught by the
EditorCouponCest.php:seeNoticeWhenCouponCantGenerateAndResumeSending
acceptance test.

This commit fixes the problem and also adds two integration tests to
protect against similar regressions in the future.

[MAILPOET-5682]
This commit is contained in:
Rodrigo Primo
2023-11-23 11:00:51 -03:00
committed by Jan Jakeš
parent 6c176450c0
commit e96251db7e
2 changed files with 26 additions and 1 deletions

View File

@@ -559,7 +559,7 @@ class SendingQueue {
}
private function stopProgress(ScheduledTaskEntity $task): void {
$task->setInProgress(true);
$task->setInProgress(false);
$this->scheduledTasksRepository->flush();
}