summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-10-11 22:12:03 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-10-11 22:12:03 +0200
commit717b01728d0cbc65a665ae6cc411d3938dfc0dfb (patch)
tree01cad55b02f65332f050b3afc9125baffd013ec1 /lib/Travel/Status/DE/HAFAS.pm
parent239820ffbaf2eab648bd278508db02440e2ff1f4 (diff)
create strptime_obj before async check (fixes new_p)
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS.pm10
1 files changed, 5 insertions, 5 deletions
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;
}