Verified Commit 0d21e43d authored by Luc Didry's avatar Luc Didry

Fix Pg sessions and urls delete fonctions

parent ebb86a63
Pipeline #95902 passed with stages
in 14 minutes and 55 seconds
......@@ -2,6 +2,9 @@ Revision history for Perl application Lstu
0.22-0 ????-??-??
0.21-3 2018-11-19
- Fix Pg sessions and urls delete fonctions
0.21-2 2018-11-19
- Fix URL removal in memcached from safebrowsingcheck and url commands
......
......@@ -12,7 +12,7 @@ sub new {
return $c;
}
sub delete {
sub remove {
my $c = shift;
my $h = $c->app->dbi->db->query('DELETE FROM sessions WHERE token = ? RETURNING *', $c->token)->hashes;
......
......@@ -21,7 +21,7 @@ sub increment_counter {
return $c;
}
sub delete {
sub remove {
my $c = shift;
my $h = $c->app->dbi->db->query('DELETE FROM lstu WHERE short = ? RETURNING *', $c->short)->hashes;
......@@ -29,6 +29,9 @@ sub delete {
# 0 means failure
# 1 means success
if ($h->size) {
if (scalar(@{$c->app->config('memcached_servers')})) {
$c->app->chi('lstu_urls_cache')->remove($c->short);
}
$c = Lstu::DB::URL->new(app => $c->app);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment