From 7d021334837eab4560e74e8ef91b6769a4e84fe3 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Sun, 20 Jul 2014 12:53:57 +0200 Subject: [PATCH] Fix participant cleanup logic --- public/vroom.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/vroom.pl b/public/vroom.pl index d8e2849..f1bca38 100755 --- a/public/vroom.pl +++ b/public/vroom.pl @@ -366,8 +366,9 @@ helper has_joined => sub { helper delete_participants => sub { my $self = shift; $self->app->log->debug('Removing inactive participants from the database'); + my $timeout = time()-600; my $sth = eval { - $self->db->prepare("DELETE FROM `participants` WHERE (`activity_timestamp` < 600 OR `activity_timestamp` IS NULL);") + $self->db->prepare("DELETE FROM `participants` WHERE (`activity_timestamp` < $timeout OR `activity_timestamp` IS NULL);") } || return undef; $sth->execute() || return undef; return 1;