# get expired reports
my $objects = $self->get_all(query => [
- session_id => [
- not => [ $::auth->active_session_ids ]
- ]
+ '!session_id' => [ $::auth->active_session_ids ]
]);
$_->destroy for @$objects;
-
- # get reports for the active session that aren't the latest
- $objects = $self->get_all(
- query => [ session_id => $::auth->get_session_id, ],
- order_by => [ 'id' ],
- );
-
- # skip the last one
- for (0 .. $#$objects - 1) {
- $objects->[$_]->destroy;
- }
}
1;
-