From 717b01728d0cbc65a665ae6cc411d3938dfc0dfb Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 11 Oct 2022 22:12:03 +0200 Subject: create strptime_obj before async check (fixes new_p) --- lib/Travel/Status/DE/HAFAS.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index 9270d2a..1da0ee8 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -291,6 +291,11 @@ sub new { }; } + $self->{strptime_obj} //= DateTime::Format::Strptime->new( + pattern => '%Y%m%dT%H%M%S', + time_zone => 'Europe/Berlin', + ); + my $json = $self->{json} = JSON->new->utf8; # The JSON request is the cache key, so if we have a cache we must ensure @@ -344,11 +349,6 @@ sub new { $self->check_mgate; - $self->{strptime_obj} //= DateTime::Format::Strptime->new( - pattern => '%Y%m%dT%H%M%S', - time_zone => 'Europe/Berlin', - ); - if ( $conf{journey} ) { $self->parse_journey; } -- cgit v1.2.3