mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
FS-4289 changed to backup the file with epoch time instead of delete it
This commit is contained in:
parent
0a4e031f2a
commit
1b8ef1842e
@ -233,9 +233,11 @@ SWITCH_DECLARE(switch_core_db_t *) switch_core_db_open_file(const char *filename
|
|||||||
if (cb_arg.ok && (1 == cb_arg.rows)) {
|
if (cb_arg.ok && (1 == cb_arg.rows)) {
|
||||||
break;
|
break;
|
||||||
} else if (0 == i) {
|
} else if (0 == i) {
|
||||||
|
char *cpath = switch_mprintf("%s.%ld.cdb", path, (long) switch_epoch_time_now(NULL));
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLite integrity_check failed for [%s]. Deleting file and retrying\n", path);
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "SQLite integrity_check failed for [%s]. Deleting file and retrying\n", path);
|
||||||
switch_core_db_close(db);
|
switch_core_db_close(db);
|
||||||
remove(path);
|
rename(path, cpath);
|
||||||
|
free(cpath);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user