diff options
author | Stefano Borzì <stefanoborzi32@gmail.com> | 2023-03-05 18:47:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-05 18:47:18 +0100 |
commit | 034b5215013600e644bd346c5273bd2ea65c2000 (patch) | |
tree | 95338c185a288e9e2a79351979126d44cdab383b /src/server/database/Database/Transaction.cpp | |
parent | a5b4aecd52ddd7e478b14dfc31f9f701fa8e192b (diff) |
feat(CI): add cppcheck (#15211)
Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>
Diffstat (limited to 'src/server/database/Database/Transaction.cpp')
-rw-r--r-- | src/server/database/Database/Transaction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/database/Database/Transaction.cpp b/src/server/database/Database/Transaction.cpp index 38f2ab051e..d5cf4fcebf 100644 --- a/src/server/database/Database/Transaction.cpp +++ b/src/server/database/Database/Transaction.cpp @@ -110,7 +110,7 @@ bool TransactionTask::Execute() // Make sure only 1 async thread retries a transaction so they don't keep dead-locking each other std::lock_guard<std::mutex> lock(_deadlockLock); - for (Milliseconds loopDuration = 0s, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) + for (Milliseconds loopDuration{}, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) { if (!TryExecute()) return true; @@ -157,7 +157,7 @@ bool TransactionWithResultTask::Execute() // Make sure only 1 async thread retries a transaction so they don't keep dead-locking each other std::lock_guard<std::mutex> lock(_deadlockLock); - for (Milliseconds loopDuration = 0s, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) + for (Milliseconds loopDuration{}, startMSTime = GetTimeMS(); loopDuration <= DEADLOCK_MAX_RETRY_TIME_MS; loopDuration = GetMSTimeDiffToNow(startMSTime)) { if (!TryExecute()) { |