aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Problems.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@cake.ukcod.org.uk>2010-05-25 00:03:46 +0100
committerMatthew Somerville <matthew@cake.ukcod.org.uk>2010-05-25 00:03:46 +0100
commit77beaf0c40637c56edee91a4e2e8966783ee8a10 (patch)
tree9611fcfc1641be618b9009dff52d08cddca1ec34 /perllib/Problems.pm
parentac21a02a722a52c5ce9bf9a84c39ce5d798a3a52 (diff)
Factor out ms_current_timestamp to see speed change.
Diffstat (limited to 'perllib/Problems.pm')
-rw-r--r--perllib/Problems.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 14fdca877..aad6c0716 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -304,10 +304,11 @@ sub council_problems {
push @params, $one_council;
$where_extra = "and areas like '%,'||?||',%'";
}
+ my $current_time = dbh()->selectrow_array('select ms_current_timestamp()');
my $problems = select_all(
"select id, title, detail, council, state, areas,
- extract(epoch from ms_current_timestamp()-lastupdate) as duration,
- extract(epoch from ms_current_timestamp()-confirmed) as age
+ extract(epoch from '$current_time'-lastupdate) as duration,
+ extract(epoch from '$current_time'-confirmed) as age
from problem
where state in ('confirmed', 'fixed')
$where_extra