fix(legacy): don't log 'could not obtain lock' exception (#1943)
Fixes #1490
This commit is contained in:
parent
c6bba21ef9
commit
eb19283d96
|
@ -63,10 +63,11 @@ final class TaskManager
|
|||
if ($task && $task->shouldBeRun()) {
|
||||
$task->run();
|
||||
}
|
||||
$this->_taskList[$taskName] = true; // Mark that the task has been checked/run.
|
||||
// This is important for prioritized tasks that
|
||||
// we need to run on every request (such as the
|
||||
// schema check/upgrade)
|
||||
// Mark that the task has been checked/run.
|
||||
// This is important for prioritized tasks that
|
||||
// we need to run on every request (such as the
|
||||
// schema check/upgrade)
|
||||
$this->_taskList[$taskName] = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -99,10 +100,15 @@ final class TaskManager
|
|||
}
|
||||
$this->_updateLock($lock);
|
||||
$this->_con->commit();
|
||||
} catch (Exception $e) {
|
||||
} catch (PDOException $e) {
|
||||
// We get here if there are simultaneous requests trying to fetch the lock row
|
||||
$this->_con->rollBack();
|
||||
Logging::warn($e->getMessage());
|
||||
|
||||
// Do not log 'could not obtain lock' exception
|
||||
// SQLSTATE[55P03]: Lock not available: 7 ERROR: could not obtain lock on row in relation "cc_pref"
|
||||
if ($e->getCode() != '55P03') {
|
||||
Logging::warn($e->getMessage());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue