fix(legacy): don't log 'could not obtain lock' exception (#1943)

Fixes #1490
This commit is contained in:
Jonas L 2022-07-07 16:47:56 +02:00 committed by GitHub
parent c6bba21ef9
commit eb19283d96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -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;
}