mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
PHRAS-4057: log_doc - report mark as "cancel" for running_job entry (#4501)
* log_docs mark as canceled too * PHRAS-4058 auto cancelling job * add auto-cancelingJob in hour in the config * add patch rc12
This commit is contained in:
@@ -503,7 +503,7 @@ class WorkerRunningJobRepository extends EntityRepository
|
||||
]);
|
||||
}
|
||||
|
||||
public function getRunningSinceCreated($hour = 0)
|
||||
public function getRunningSinceCreated($hour = 0, array $action = null)
|
||||
{
|
||||
$rsm = new ResultSetMappingBuilder($this->_em);
|
||||
$rsm->addRootEntityFromClassMetadata('Alchemy\Phrasea\Model\Entities\WorkerRunningJob', 'w');
|
||||
@@ -516,6 +516,11 @@ class WorkerRunningJobRepository extends EntityRepository
|
||||
AND (TO_SECONDS(CURRENT_TIMESTAMP()) - TO_SECONDS(w.created)) > :second'
|
||||
;
|
||||
|
||||
if ($action != null) {
|
||||
$action = join('" ,"', $action);
|
||||
$sql .= ' AND work IN("' . $action . '")';
|
||||
}
|
||||
|
||||
$q = $this->_em->createNativeQuery($sql, $rsm);
|
||||
$q->setParameters([
|
||||
'second' => $hour * 3600,
|
||||
|
Reference in New Issue
Block a user