tweak to standby mode
This commit is contained in:
parent
03bfc941a1
commit
f3b1809a63
|
@ -1711,11 +1711,6 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
||||||
/* While we're running, or there is a pending sql statment that we haven't appended to sqlbuf yet, because of a lack of buffer space */
|
/* While we're running, or there is a pending sql statment that we haven't appended to sqlbuf yet, because of a lack of buffer space */
|
||||||
while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || sql) {
|
while ((mod_sofia_globals.running == 1 && sofia_test_pflag(profile, PFLAG_RUNNING)) || sql) {
|
||||||
|
|
||||||
if (sofia_test_pflag(profile, PFLAG_STANDBY)) {
|
|
||||||
switch_yield(1000000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
|
if (sofia_test_pflag(profile, PFLAG_SQL_IN_TRANS)) {
|
||||||
/* Do we have enough statements or is the timeout expired */
|
/* Do we have enough statements or is the timeout expired */
|
||||||
while (sql || (sofia_test_pflag(profile, PFLAG_RUNNING) && mod_sofia_globals.running == 1 &&
|
while (sql || (sofia_test_pflag(profile, PFLAG_RUNNING) && mod_sofia_globals.running == 1 &&
|
||||||
|
@ -1812,6 +1807,8 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!sofia_test_pflag(profile, PFLAG_STANDBY)) {
|
||||||
if (++ireg_loops >= IREG_SECONDS) {
|
if (++ireg_loops >= IREG_SECONDS) {
|
||||||
time_t now = switch_epoch_time_now(NULL);
|
time_t now = switch_epoch_time_now(NULL);
|
||||||
sofia_reg_check_expire(profile, now, 0);
|
sofia_reg_check_expire(profile, now, 0);
|
||||||
|
@ -1824,6 +1821,7 @@ void *SWITCH_THREAD_FUNC sofia_profile_worker_thread_run(switch_thread_t *thread
|
||||||
}
|
}
|
||||||
|
|
||||||
sofia_sub_check_gateway(profile, time(NULL));
|
sofia_sub_check_gateway(profile, time(NULL));
|
||||||
|
}
|
||||||
|
|
||||||
last_check = switch_micro_time_now();
|
last_check = switch_micro_time_now();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue