changeset 30:4f60cf394839

pasterd: enable lock timeout
author David Demelier <markand@malikania.fr>
date Tue, 11 Feb 2020 12:30:00 +0100
parents f3ba621ab51f
children 5f95e28ba3bb
files database.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/database.c	Sun Feb 09 11:16:21 2020 +0100
+++ b/database.c	Tue Feb 11 12:30:00 2020 +0100
@@ -162,6 +162,9 @@
 		return false;
 	}
 
+	/* Wait for 30 seconds to lock the database. */
+	sqlite3_busy_timeout(db, 30000);
+
 	if (sqlite3_exec(db, sql_init, NULL, NULL, NULL) != SQLITE_OK) {
 		log_warn("database: unable to initialize %s: %s", path, sqlite3_errmsg(db));
 		return false;