Skip to content

Commit

Permalink
Tolerate if the database is (shorty) locked when trying to create an …
Browse files Browse the repository at this point in the history
…in-memory Teleporter database

Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Jan 8, 2025
1 parent 2c46c88 commit 98494d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/zip/teleporter.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ static bool create_teleporter_database(const char *filename, const char **tables

snprintf(attach_stmt, sizeof(attach_stmt), "ATTACH DATABASE '%s' AS \"disk\";", filename);

// Set busy timeout to 1 second to access the database in a
// multi-threaded environment
if(sqlite3_busy_timeout(db, 1000) != SQLITE_OK)
log_warn("Failed to set busy timeout during creation of in-memory Teleporter database: %s", sqlite3_errmsg(db));

if(sqlite3_exec(db, attach_stmt, NULL, NULL, &err) != SQLITE_OK)
{
log_warn("Failed to attach database \"%s\" to in-memory database: %s", filename, err);
Expand Down

0 comments on commit 98494d1

Please sign in to comment.