mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
ref
This commit is contained in:
@@ -144,10 +144,11 @@ class ScheduledJob
|
||||
|
||||
$format = DateTimeUtil::SYSTEM_DATE_TIME_FORMAT;
|
||||
|
||||
$selectParams = [
|
||||
'select' => ['id'],
|
||||
'leftJoins' => ['scheduledJob'],
|
||||
'whereClause' => [
|
||||
return (bool) $this->entityManager
|
||||
->getRDBRepository(Job::ENTITY_TYPE)
|
||||
->select(['id'])
|
||||
->leftJoin('scheduledJob')
|
||||
->where([
|
||||
'OR' => [
|
||||
[
|
||||
['executedAt>=' => $r2From->format($format)],
|
||||
@@ -159,9 +160,7 @@ class ScheduledJob
|
||||
'scheduledJob.job' => 'Dummy',
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return (bool) $this->entityManager->getRDBRepository(Job::ENTITY_TYPE)->findOne($selectParams);
|
||||
])
|
||||
->findOne();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ use Espo\Core\Utils\Log;
|
||||
use Espo\ORM\EntityManager;
|
||||
use Espo\ORM\Query\Part\Condition as Cond;
|
||||
|
||||
use Espo\ORM\Query\SelectBuilder;
|
||||
use Exception;
|
||||
use stdClass;
|
||||
|
||||
@@ -228,12 +229,16 @@ class Queue
|
||||
$target = null;
|
||||
|
||||
if ($this->entityManager->hasRepository($targetType)) {
|
||||
$query = SelectBuilder::create()
|
||||
->from($targetType)
|
||||
->withDeleted()
|
||||
->build();
|
||||
|
||||
$target = $this->entityManager
|
||||
->getRDBRepository($targetType)
|
||||
->where([
|
||||
'id' => $item->get('targetId')
|
||||
])
|
||||
->findOne(['withDeleted' => true]);
|
||||
->clone($query)
|
||||
->where(['id' => $item->get('targetId')])
|
||||
->findOne();
|
||||
}
|
||||
|
||||
if (!$target) {
|
||||
|
||||
Reference in New Issue
Block a user