Set status of scheduled_task to invalid if it has not subs

[MAILPOET-5134]
This commit is contained in:
Sam Najian
2023-03-16 21:08:30 +01:00
committed by Aschepikov
parent cb786ee57f
commit 397232e932
2 changed files with 17 additions and 0 deletions

View File

@@ -309,6 +309,12 @@ class ScheduledTasksRepository extends Repository {
->getResult();
}
public function invalidateTask(ScheduledTaskEntity $task): void {
$task->setStatus( ScheduledTaskEntity::STATUS_INVALID);
$this->persist($task);
$this->flush();
}
protected function findByTypeAndStatus($type, $status, $limit = null, $future = false) {
$queryBuilder = $this->doctrineRepository->createQueryBuilder('st')
->select('st')