projects
/
APKPM.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca533c8
)
store last table.name.username json for 15 min
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 11 Jul 2011 16:29:18 +0000
(18:29 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 11 Jul 2011 16:29:18 +0000
(18:29 +0200)
lib/APKPM/Store.pm
patch
|
blob
|
history
diff --git
a/lib/APKPM/Store.pm
b/lib/APKPM/Store.pm
index
fed95f3
..
def1d83
100644
(file)
--- a/
lib/APKPM/Store.pm
+++ b/
lib/APKPM/Store.pm
@@
-48,6
+48,12
@@
sub pg_insert {
my $h_lc;
$h_lc->{ lc $_ } = $h->{$_} foreach keys %$h;
+ if ( my $username = $h->{username} ) {
+ my $key = join('.', 'table', $table, $username);
+ $redis->set( $key => $self->e_json($h) );
+ $redis->expire( $key => 15 * 60 ); # 15 min timeout
+ }
+
$sth->execute( map { $h_lc->{$_} } @c );
}