From c93313e94175b75bdf590acd316cb614aca5bb58 Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Fri, 28 Jul 2023 22:38:22 +0200 Subject: [PATCH] Making the website work without db. --- lib/BurguillosInfo/Controller/Metrics.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/BurguillosInfo/Controller/Metrics.pm b/lib/BurguillosInfo/Controller/Metrics.pm index 2d0ebd2..e6ec96f 100644 --- a/lib/BurguillosInfo/Controller/Metrics.pm +++ b/lib/BurguillosInfo/Controller/Metrics.pm @@ -20,12 +20,17 @@ my $tracking; my $iso8601 = DateTime::Format::ISO8601->new; sub request { shift; - my $c = shift; - my $app = $c->app; - if (!defined $tracking) { - $tracking = BurguillosInfo::Tracking->new($app); - } - $tracking->register_request($c); + eval { + my $c = shift; + my $app = $c->app; + if (!defined $tracking) { + $tracking = BurguillosInfo::Tracking->new($app); + } + $tracking->register_request($c); + }; + if ($@) { + say STDERR $@; + } } sub stats {