diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-17 09:27:17 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2023-04-17 09:27:17 -0400 |
commit | b1343e8ad1cd158228e9fd97c493aa888700419c (patch) | |
tree | ea1ba65f8767dbb1307cfebf39ed44746df8a7bf /src/libstore/sqlite.cc | |
parent | 615c25b0dd185fe15d6be5fe7266d0f4e0a4d807 (diff) | |
parent | 72ffa7fedb34585948f8c9a47bfaebeb6cc5d537 (diff) |
Merge remote-tracking branch 'upstream/master' into trustless-remote-builder-simple
Diffstat (limited to 'src/libstore/sqlite.cc')
-rw-r--r-- | src/libstore/sqlite.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 871f2f3be..df334c23c 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -239,14 +239,11 @@ SQLiteTxn::~SQLiteTxn() } } -void handleSQLiteBusy(const SQLiteBusy & e) +void handleSQLiteBusy(const SQLiteBusy & e, time_t & nextWarning) { - static std::atomic<time_t> lastWarned{0}; - time_t now = time(0); - - if (now > lastWarned + 10) { - lastWarned = now; + if (now > nextWarning) { + nextWarning = now + 10; logWarning({ .msg = hintfmt(e.what()) }); |