Unverified Commit 717b0172 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

create strptime_obj before async check (fixes new_p)

parent 239820ff
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;
	}