From f9664856c7b6e132bae62b35e944d3d95aca7898 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 14 Jun 2024 21:49:49 +0200 Subject: work: _really_ do not execute any database actions in maintenance mode --- lib/Travelynx/Command/work.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index c9ac9b7..b80b0a4 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -21,6 +21,11 @@ sub run { my $checkin_deadline = $now->clone->subtract( hours => 48 ); my $json = JSON->new; + if ( -e 'maintenance' ) { + $self->app->log->debug('maintenance mode, quitting '); + return; + } + my $num_incomplete = $self->app->in_transit->delete_incomplete_checkins( earlier_than => $checkin_deadline ); @@ -33,6 +38,7 @@ sub run { for my $entry ( $self->app->in_transit->get_all_active ) { if ( -e 'maintenance' ) { + $self->app->log->debug('maintenance mode, quitting '); return; } -- cgit v1.2.3