wait longer to retry on locked db
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15440 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
70d696fc37
commit
054d40a7e1
|
@ -86,15 +86,16 @@ SWITCH_DECLARE(const char *) switch_core_db_errmsg(switch_core_db_t *db)
|
|||
SWITCH_DECLARE(int) switch_core_db_exec(switch_core_db_t *db, const char *sql, switch_core_db_callback_func_t callback, void *data, char **errmsg)
|
||||
{
|
||||
int ret = 0;
|
||||
int sane = 500;
|
||||
int sane = 100;
|
||||
char *err = NULL;
|
||||
|
||||
while (--sane > 0) {
|
||||
ret = sqlite3_exec(db, sql, callback, data, &err);
|
||||
|
||||
if (ret == SQLITE_BUSY || ret == SQLITE_LOCKED) {
|
||||
if (sane > 1) {
|
||||
switch_safe_free(err);
|
||||
switch_cond_next();
|
||||
switch_yield(100000);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue