Skip to content
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Commit 0aa5dfc

Browse files
stanislav.kovinTekill
authored andcommitted
SCENTRE-6184 Republish queue in initial status
1 parent 047bd4b commit 0aa5dfc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Entity/QueueRepository.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,27 @@ public function getToRepublish(int $limit, ?int $offset = null): array
7373
->where(
7474
$qb->expr()->andX(
7575
$qb->expr()->in('queue.status', ':statuses'),
76-
$qb->expr()->eq('queue.isDeleted', ':not_deleted'),
7776
$qb->expr()->lte('queue.scheduledAt', ':now')
7877
)
7978
)
79+
->orWhere(
80+
$qb->expr()->andX(
81+
$qb->expr()->eq('queue.status', ':initial_status'),
82+
$qb->expr()->lte('queue.createdAt', ':from_created_at')
83+
)
84+
)
85+
->andWhere(
86+
$qb->expr()->eq('queue.isDeleted', ':not_deleted')
87+
)
8088
->setParameters(
8189
[
8290
'statuses' => [
8391
QueueEntityMappedSuperclass::STATUS_WAITING,
8492
QueueEntityMappedSuperclass::STATUS_SCHEDULED,
8593
],
8694
'now' => new DateTime(),
95+
'initial_status' => QueueEntityMappedSuperclass::STATUS_INITIAL,
96+
'from_created_at' => (new DateTime())->modify('-5 minute'),
8797
]
8898
)
8999
->setParameter('not_deleted', false, PDO::PARAM_BOOL)

0 commit comments

Comments
 (0)