Fixed a bug where DB pruning would delete pastes with no expiration date as well as pastes that had legitimately expired

This commit is contained in:
Matthew Connelly 2015-04-15 04:38:27 +01:00
parent aa63c16177
commit 65cb180296
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ sub GetUUID {
sub CheckExpired {
return unless time > ($lastexpunge+900); #expunge once every 15 mins
$lastexpunge = time;
schema->resultset('Paste')->search({ expiration => [undef, { '<' => DateTimeToQueryable() }]})->delete_all;
schema->resultset('Paste')->search({ expiration => { '<' => DateTimeToQueryable() }})->delete_all;
}
sub ValidateParams {
my $params = shift;