add fsctl flush_db_handles to expire any unused db handles
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15982 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
309c4c54bd
commit
ba8e009228
|
@ -2044,6 +2044,7 @@ SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute(switch_cache_
|
|||
SWITCH_DECLARE(switch_status_t) switch_cache_db_persistant_execute_trans(switch_cache_db_handle_t *dbh, char *sql, uint32_t retries);
|
||||
SWITCH_DECLARE(void) switch_cache_db_detach(void);
|
||||
SWITCH_DECLARE(uint32_t) switch_core_debug_level(void);
|
||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void);
|
||||
|
||||
SWITCH_END_EXTERN_C
|
||||
#endif
|
||||
|
|
|
@ -1431,7 +1431,8 @@ typedef enum {
|
|||
SCSC_SHUTDOWN_ASAP,
|
||||
SCSC_CANCEL_SHUTDOWN,
|
||||
SCSC_SEND_SIGHUP,
|
||||
SCSC_DEBUG_LEVEL
|
||||
SCSC_DEBUG_LEVEL,
|
||||
SCSC_FLUSH_DB_HANDLES
|
||||
} switch_session_ctl_t;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
@ -1349,6 +1349,9 @@ SWITCH_STANDARD_API(ctl_function)
|
|||
arg = 1;
|
||||
switch_core_session_ctl(SCSC_HUPALL, &arg);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "flush_db_handles")) {
|
||||
switch_core_session_ctl(SCSC_FLUSH_DB_HANDLES, NULL);
|
||||
stream->write_function(stream, "+OK\n");
|
||||
} else if (!strcasecmp(argv[0], "pause")) {
|
||||
arg = 1;
|
||||
switch_core_session_ctl(SCSC_PAUSE_INBOUND, &arg);
|
||||
|
@ -3944,6 +3947,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
|
|||
switch_console_set_complete("add fsctl shutdown restart elegant");
|
||||
switch_console_set_complete("add fsctl sps");
|
||||
switch_console_set_complete("add fsctl sync_clock");
|
||||
switch_console_set_complete("add fsctl flush_db_handles");
|
||||
switch_console_set_complete("add nat_map reinit");
|
||||
switch_console_set_complete("add nat_map republish");
|
||||
switch_console_set_complete("add nat_map status");
|
||||
|
|
|
@ -1568,6 +1568,9 @@ SWITCH_DECLARE(int32_t) switch_core_session_ctl(switch_session_ctl_t cmd, int32_
|
|||
}
|
||||
|
||||
switch (cmd) {
|
||||
case SCSC_FLUSH_DB_HANDLES:
|
||||
switch_cache_db_flush_handles();
|
||||
break;
|
||||
case SCSC_SEND_SIGHUP:
|
||||
handle_SIGHUP(1);
|
||||
break;
|
||||
|
|
|
@ -144,6 +144,13 @@ static void sql_close(time_t prune)
|
|||
}
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_flush_handles(void)
|
||||
{
|
||||
sql_close(switch_epoch_time_now(NULL) + SQL_CACHE_TIMEOUT + 1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
SWITCH_DECLARE(void) switch_cache_db_release_db_handle(switch_cache_db_handle_t **dbh)
|
||||
{
|
||||
if (dbh && *dbh) {
|
||||
|
|
Loading…
Reference in New Issue