From 054d40a7e1e1404f5367c7107d354bcd515bf66e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 12 Nov 2009 03:48:07 +0000 Subject: [PATCH] wait longer to retry on locked db git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15440 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_core_db.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/switch_core_db.c b/src/switch_core_db.c index db97a8e81f..4890571562 100644 --- a/src/switch_core_db.c +++ b/src/switch_core_db.c @@ -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 {