TT#98100 re-init stmt handlers each iteration

Change-Id: I9bbbb5aa7ca939f4c2b23f03f376db1d7da58fe0
mr9.1.1
Rene Krenn 5 years ago
parent 54bfa88e4d
commit 1871fb03a6

@ -3541,10 +3541,7 @@ sub main {
while (!$shutdown) {
$log_fatal = 1;
$billdbh->ping || init_db;
$acctdbh->ping || init_db;
$provdbh and ($provdbh->ping || init_db);
$dupdbh and ($dupdbh->ping || init_db);
init_db or FATAL "Error initializing database handlers\n";
clear_prepaid_cost_cache();
my $error;
@ -3686,12 +3683,20 @@ sub main {
INFO "There were $failed failed CDRs, sleep $failed_cdr_retry_delay";
sleep($failed_cdr_retry_delay);
}
close_db();
}
notify_send("STOPPING=1\n");
INFO "Shutting down.\n";
close $pidfh;
unlink $pidfile;
}
sub close_db {
$sth_get_subscriber_contract_id->finish;
$sth_billing_info_network->finish;
$sth_billing_info->finish;
@ -3752,7 +3757,5 @@ sub main {
$acctdbh->disconnect;
$provdbh and $provdbh->disconnect;
$dupdbh and $dupdbh->disconnect;
close $pidfh;
unlink $pidfile;
}

Loading…
Cancel
Save