From 312d9e75343a41baf2d141cbf385ecd40adc6b19 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Mon, 9 Dec 2019 10:15:24 +0100 Subject: [PATCH] TT#71908 increase wait timeout when rendering invoicepdf Change-Id: I6de865819a96d432bfb231c9bd19a2d309b32d2f --- lib/NGCP/Panel/Model/DB.pm | 11 +++++++++++ lib/NGCP/Panel/Utils/Invoice.pm | 1 + 2 files changed, 12 insertions(+) diff --git a/lib/NGCP/Panel/Model/DB.pm b/lib/NGCP/Panel/Model/DB.pm index 28e879523e..a547488f46 100644 --- a/lib/NGCP/Panel/Model/DB.pm +++ b/lib/NGCP/Panel/Model/DB.pm @@ -20,6 +20,17 @@ sub set_transaction_isolation { ); } +sub set_wait_timeout { + my ($self,$timeout) = @_; + return $self->storage->dbh_do( + sub { + my ($storage, $dbh, @args) = @_; + $dbh->do("SET SESSION wait_timeout = " . $args[0]); + }, + $timeout, + ); +} + 1; __END__ diff --git a/lib/NGCP/Panel/Utils/Invoice.pm b/lib/NGCP/Panel/Utils/Invoice.pm index 2369b74f4f..ec25bb67db 100644 --- a/lib/NGCP/Panel/Utils/Invoice.pm +++ b/lib/NGCP/Panel/Utils/Invoice.pm @@ -53,6 +53,7 @@ sub create_invoice{ my $invoice; my $schema = $c->model('DB'); + $schema->set_wait_timeout(1800); #this has to be refactored - select a contract balance instead of a "period" my $balance = NGCP::Panel::Utils::ProfilePackages::get_contract_balance( c => $c,