From 3571f96251df08dd8a9dda3ec4e1fadf30d6c63d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 10 Feb 2015 17:10:40 +0000 Subject: Create timezone objects only once at startup. Cache a DateTime::TimeZone::Local object, so that in an environment where /etc/localtime is a copy of a timezone file, we don't repeatedly walk all the timezone files to find the matching one. --- bin/send-comments | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/send-comments') diff --git a/bin/send-comments b/bin/send-comments index 2d6b525b5..fabf2b633 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -145,7 +145,7 @@ while ( my $body = $bodies->next ) { sub bromley_retry_timeout { my $row = shift; - my $tz = DateTime::TimeZone->new( name => 'local' ); + my $tz = FixMyStreet->local_time_zone; my $now = DateTime->now( time_zone => $tz ); my $diff = $now - $row->send_fail_timestamp; if ( $diff->in_units( 'minutes' ) < 30 ) { -- cgit v1.2.3