aboutsummaryrefslogtreecommitdiffstats
path: root/bin/send-comments
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-02-10 17:10:40 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2015-02-13 10:09:33 +0000
commit3571f96251df08dd8a9dda3ec4e1fadf30d6c63d (patch)
tree6cd0d05d06a51dfdcbe183c4c10b38c0a15c6231 /bin/send-comments
parent9591ba909210b2a628237074b54e5eb3c6536856 (diff)
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.
Diffstat (limited to 'bin/send-comments')
-rwxr-xr-xbin/send-comments2
1 files changed, 1 insertions, 1 deletions
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 ) {