Fix participant cleanup logic

master
Daniel Berteaud 10 years ago
parent b8576f687b
commit 7d02133483
  1. 3
      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;

Loading…
Cancel
Save