diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-07-10 10:42:05 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-07-10 10:42:05 +0200 |
commit | 105fc8a4a1a55c6dea61273c2ca3e0b10db19b86 (patch) | |
tree | 89974d7b276324c48c85397d9a9c562f32ca7cb3 /lib/Travelynx | |
parent | a88dea059bf92481556d2469ef157e545a3bb180 (diff) |
maintenance: show details when about to delete a large amount of UIDs
Diffstat (limited to 'lib/Travelynx')
-rw-r--r-- | lib/Travelynx/Command/maintenance.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/maintenance.pm b/lib/Travelynx/Command/maintenance.pm index 35264e4..be929ac 100644 --- a/lib/Travelynx/Command/maintenance.pm +++ b/lib/Travelynx/Command/maintenance.pm @@ -126,6 +126,17 @@ sub run { "About to delete %d accounts, which is quite a lot.\n", scalar @uids_to_delete ); + for my $uid (@uids_to_delete) { + my $journeys_res = $db->select( + 'journeys', + 'count(*) as count', + { user_id => $uid } + )->hash; + printf STDERR ( + " - UID %5d (%4d journeys)\n", + $uid, $journeys_res->{count} + ); + } say STDERR 'Aborting maintenance. Please investigate.'; exit(1); } |