store data in redis under table.name.login without timestamp
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 20 May 2012 19:54:03 +0000 (21:54 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 20 May 2012 19:54:03 +0000 (21:54 +0200)
lib/APKPM/Store.pm

index 9e5ac67..bce29ac 100644 (file)
@@ -64,7 +64,9 @@ order by
 }
 
 sub pg_insert {
-       my ( $self, $table, $h ) = @_;
+       my ( $self, $base_table, $h ) = @_;
+
+       my $table = $base_table;
 
        my @c;
 
@@ -109,7 +111,7 @@ sub pg_insert {
        $h_lc->{ lc $_ } = $h->{$_} foreach keys %$h;
 
        if ( my $username = $h->{username} ) {
-               my $key = join('.', 'table', $table, $username);
+               my $key = join('.', 'table', $base_table, $username);
                $self->redis->set( $key => $self->e_json($h) );
                $self->redis->expire( $key => 15 * 60 ); # 15 min timeout
        }