1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 07:33:16 +02:00

Move warning timing logic into handleSQLiteBusy.

This commit is contained in:
Ben Radford 2023-04-11 16:03:37 +01:00
parent da322ebda6
commit de3df3009b
No known key found for this signature in database
GPG key ID: 9DF5D4640AB888D5
2 changed files with 6 additions and 13 deletions

View file

@ -239,9 +239,11 @@ SQLiteTxn::~SQLiteTxn()
}
}
void handleSQLiteBusy(const SQLiteBusy & e, bool shouldWarn)
void handleSQLiteBusy(const SQLiteBusy & e, time_t & nextWarning)
{
if (shouldWarn) {
time_t now = time(0);
if (now > nextWarning) {
nextWarning = now + 10;
logWarning({
.msg = hintfmt(e.what())
});