aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/sqlite.cc
diff options
context:
space:
mode:
authorBen Radford <benradf@users.noreply.github.com>2023-04-11 16:03:37 +0100
committerBen Radford <benradf@users.noreply.github.com>2023-04-11 16:14:16 +0100
commitde3df3009bf003f327d35e246d5904d93273e2e9 (patch)
tree75e7f17f5dda6717470d845ee750c680c23c4519 /src/libstore/sqlite.cc
parentda322ebda62470acbf5373374c4cee8236705c2f (diff)
Move warning timing logic into handleSQLiteBusy.
Diffstat (limited to 'src/libstore/sqlite.cc')
-rw-r--r--src/libstore/sqlite.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index c57e58fe0..df334c23c 100644
--- a/src/libstore/sqlite.cc
+++ b/src/libstore/sqlite.cc
@@ -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())
});