summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/maintenance.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-07 19:06:21 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-07 19:06:21 +0100
commit574e83d56727a088d57d4bb1c7dcd37a2c67f1fd (patch)
tree1fdf0ac2a26c2575a7aac15eb8f98dff1ae9fd3e /lib/Travelynx/Command/maintenance.pm
parenta21826a055a5f477560537f4bd022a7cdb15d50a (diff)
Move incomplete checkin removal from "maintenance" to "work" task
Diffstat (limited to 'lib/Travelynx/Command/maintenance.pm')
-rw-r--r--lib/Travelynx/Command/maintenance.pm10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/Travelynx/Command/maintenance.pm b/lib/Travelynx/Command/maintenance.pm
index a8aee31..5f609cb 100644
--- a/lib/Travelynx/Command/maintenance.pm
+++ b/lib/Travelynx/Command/maintenance.pm
@@ -15,7 +15,6 @@ sub run {
my ( $self, $filename ) = @_;
my $now = DateTime->now( time_zone => 'Europe/Berlin' );
- my $checkin_deadline = $now->clone->subtract( hours => 48 );
my $verification_deadline = $now->clone->subtract( hours => 48 );
my $deletion_deadline = $now->clone->subtract( hours => 72 );
my $old_deadline = $now->clone->subtract( years => 1 );
@@ -23,13 +22,6 @@ sub run {
my $db = $self->app->pg->db;
my $tx = $db->begin;
- my $res = $db->delete( 'in_transit',
- { checkin_time => { '<', $checkin_deadline } } );
-
- if ( my $rows = $res->rows ) {
- printf( "Removed %d incomplete checkins\n", $rows );
- }
-
my $unverified = $db->select(
'users',
'id, email, extract(epoch from registered_at) as registered_ts',
@@ -76,7 +68,7 @@ sub run {
printf( "Pruned unverified user %d\n", $user->{id} );
}
- $res = $db->delete( 'pending_passwords',
+ my $res = $db->delete( 'pending_passwords',
{ requested_at => { '<', $verification_deadline } } );
if ( my $rows = $res->rows ) {