diff options
Diffstat (limited to 'lib/MasterServer/Database/dbMaintenance.pm')
| -rwxr-xr-x | lib/MasterServer/Database/dbMaintenance.pm | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/MasterServer/Database/dbMaintenance.pm b/lib/MasterServer/Database/dbMaintenance.pm deleted file mode 100755 index 41ea93a..0000000 --- a/lib/MasterServer/Database/dbMaintenance.pm +++ /dev/null @@ -1,40 +0,0 @@ -package MasterServer::Database::dbMaintenance; - -use strict; -use warnings; -use Exporter 'import'; - -our @EXPORT = qw| delete_old_pending - remove_pending |; - -################################################################################ -## delete unresponsive servers from the pending list -## where the server is unresponsive for more than 1 hour -################################################################################ -sub delete_old_pending { - my ($self) = shift; - - # remove servers - my $u = $self->{dbh}->do( - "DELETE FROM pending - WHERE added < to_timestamp(?)", undef, time-3600); - - # notify - $self->log("delete", "Removed $u entries from pending.") if ($u > 0); -} - -################################################################################ -## Remove an entry from the pending list. Returns 0 if removed or -1 in case -## of error(s). -################################################################################ -sub remove_pending { - my ($self, $id) = @_; - - # if address is in list, update the timestamp - my $u = $self->{dbh}->do("DELETE FROM pending WHERE id = ?", undef, $id); - - # notify - $self->log("delete", "removed pending id $id from pending") if ($u > 0); -} - -1; |
