diff options
author | Yorhel <git@yorhel.nl> | 2014-10-22 09:02:08 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2014-10-22 09:02:08 +0200 |
commit | bc07a24f87de5da7f12907d1486099766b7fa27b (patch) | |
tree | 255094e784bd5712442cca4ab749f7c228a5d5c5 /lib/Multi | |
parent | 60705baedb2448b6b7cfc5289678d4080b565b8e (diff) |
Multi::Feed: Log SQL times
Requires a patch to AnyEvent::Pg:
https://rt.cpan.org/Ticket/Display.html?id=99719
Diffstat (limited to 'lib/Multi')
-rw-r--r-- | lib/Multi/Feed.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Multi/Feed.pm b/lib/Multi/Feed.pm index 17147eb5..ac171c15 100644 --- a/lib/Multi/Feed.pm +++ b/lib/Multi/Feed.pm @@ -41,7 +41,7 @@ sub generate { ORDER BY t.id DESC LIMIT $1}, args => [$VNDB::S{atom_feeds}{announcements}[0]], - on_result => sub { write_atom(announcements => $_[2], $a) }, + on_result => sub { write_atom(announcements => @_[2,3], $a) }, ); # changes @@ -60,7 +60,7 @@ sub generate { ORDER BY c.id DESC LIMIT $1}, args => [$VNDB::S{atom_feeds}{changes}[0]], - on_result => sub { write_atom(changes => $_[2], $c); }, + on_result => sub { write_atom(changes => @_[2,3], $c); }, ); # posts (this query isn't all that fast) @@ -75,16 +75,15 @@ sub generate { ORDER BY tp.date DESC LIMIT $1}, args => [$VNDB::S{atom_feeds}{posts}[0]], - on_result => sub { write_atom(posts => $_[2], $p); }, + on_result => sub { write_atom(posts => @_[2,3], $p); }, ); } sub write_atom { - my($feed, $res) = @_; + my($feed, $res, $sqltime) = @_; return if pg_expect $res, 1; - my $sqltime = 0; # TODO: Figure out how to obtain this my $start = AE::time; my @r = $res->rowsAsHashes; |