From: Sam Hartman Date: Tue, 7 Oct 2014 10:08:55 +0000 (-0400) Subject: Set busy timeout X-Git-Tag: 1.4.1~1 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=commitdiff_plain;h=fd7166883be362de39bd446ddbbc46aa4a692a68 Set busy timeout Set a busy timeout in the tids sqlite3 setup code so that we do not fail on any database locking. As an example in 1.4 if two tids processes try to write at the same time, one will fail. --- diff --git a/tid/example/tids_main.c b/tid/example/tids_main.c index e920874..29a43b8 100644 --- a/tid/example/tids_main.c +++ b/tid/example/tids_main.c @@ -276,6 +276,7 @@ int main (int argc, fprintf(stdout, "Error opening database %s\n", argv[4]); exit(1); } + sqlite3_busy_timeout( db, 1000); sqlite3_prepare_v2(db, "insert into psk_keys (keyid, key, client_dh_pub) values(?, ?, ?)", -1, &insert_stmt, NULL); sqlite3_prepare_v2(db, "insert into authorizations (client_dh_pub, coi, acceptor_realm, hostname, apc) values(?, ?, ?, ?, ?)",