forked from cory/tildefriends
ssb: Chasing intermittent SQLITE_ERROR with multiple processes accessing the database. Switching to sqlite3_prepare_v2 for better errors, but maybe this is also the solution?
This commit is contained in:
12
src/ssb.c
12
src/ssb.c
@ -2834,7 +2834,11 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
|
||||
}
|
||||
if (ssb->db_writer)
|
||||
{
|
||||
sqlite3_close(ssb->db_writer);
|
||||
int r = sqlite3_close(ssb->db_writer);
|
||||
if (r != SQLITE_OK)
|
||||
{
|
||||
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
|
||||
}
|
||||
ssb->db_writer = NULL;
|
||||
}
|
||||
while (ssb->broadcasts)
|
||||
@ -2846,7 +2850,11 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
|
||||
}
|
||||
for (int i = 0; i < ssb->db_readers_count; i++)
|
||||
{
|
||||
sqlite3_close(ssb->db_readers[i]);
|
||||
int r = sqlite3_close(ssb->db_readers[i]);
|
||||
if (r != SQLITE_OK)
|
||||
{
|
||||
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
|
||||
}
|
||||
}
|
||||
ssb->db_readers_count = 0;
|
||||
if (ssb->db_readers)
|
||||
|
Reference in New Issue
Block a user