Метод getCandidatesQuery
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesim/lib/V2/Integration/HumanResources/Sync/SyncProcessor/Base.php
Исходный код
Сигнатура метода
protected function getCandidatesQuery(int $afterId, DateTime $threshold): Query
Возвращает:
Query
Описание
Free rows and rows whose owner is overdue, in one walk. Fresh work still has priority over recovery, but not for ever: a tick takes a single item, so behind "no ordinary work left" a row locked by a process that died would wait out the whole inflow of the queue. Past several return delays it joins the ordinary candidates and the order by id decides as usual - whether its owner is really gone is answered by ownership, not by age. The two states are one condition and not a query each because the queue carries no index over IS_LOCKED: this way the read is a walk of the primary key in the order of the page and stops at the tenth row it needs, while a query for the locked state alone has nothing to stop it early.
Параметры
2| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$afterId
|
int
|
-
|
-
|
$threshold
|
DateTime
|
-
|
-
|