]> granicus.if.org Git - vnstat/commitdiff
move timeout definition, mention addition in changes
authorTeemu Toivola <git@humdi.net>
Sat, 11 May 2019 18:38:14 +0000 (21:38 +0300)
committerTeemu Toivola <git@humdi.net>
Sat, 11 May 2019 18:38:14 +0000 (21:38 +0300)
CHANGES
src/common.h
src/dbsql.c

diff --git a/CHANGES b/CHANGES
index 9f02ed75e1045fbf1f5fe2d2aa4f9a306b6eb38b..82d7e73e70802779ba95bfa4ae4197435665f9e4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,8 @@
      see https://www.sqlite.org/wal.html for more details and note that
      SQLite 3.22.0 or later is required to support read-only operations
    - Show warning in log if writing cached data to database is slow
+   - Try database query for up to 5 seconds when database is busy or locked
+     instead of giving up immediately
 
 
 2.2 / 28-Apr-2018
index 2ce581f9e9dcfff46f0f714400da5fc8e9ce2f16..296fa48ac53e26207d665ff60a7b577b9e95f21a 100644 (file)
@@ -235,6 +235,9 @@ and most can be changed later from the config file.
 #define WALDBCHECKPOINTINTERVALMINS 240
 #define SLOWDBFLUSHWARNLIMIT 3.0
 
+/* database read timeout */
+#define DBREADTIMEOUTSECS 5
+
 /* no transparency by default */
 #define TRANSBG 0
 
index 877ef7f07f80608ad84cbc69ed06c54a48032120..73babe8d82debe5199f502b829dd92fc72a414e5 100644 (file)
@@ -100,9 +100,9 @@ int db_open(const int createifnotfound, const int readonly)
                        db_close();
                        return 0;
                }
-       /* set/increase busy timeout to 5 seconds */
        } else {
-               sqlite3_busy_timeout(db, 5000);
+               /* set busy timeout when database is open in read-only mode */
+               sqlite3_busy_timeout(db, DBREADTIMEOUTSECS * 1000);
        }
 
        if (!createdb) {