maintenance: Log deletion notification to stdout

This commit is contained in:
Daniel Friesel 2022-02-18 17:21:49 +01:00
parent 582bfbe661
commit 01053f9d41
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -14,10 +14,10 @@ has usage => sub { shift->extract_usage };
sub run { sub run {
my ( $self, $filename ) = @_; my ( $self, $filename ) = @_;
my $now = DateTime->now( time_zone => 'Europe/Berlin' ); my $now = DateTime->now( time_zone => 'Europe/Berlin' );
my $verification_deadline = $now->clone->subtract( hours => 48 ); my $verification_deadline = $now->clone->subtract( hours => 48 );
my $deletion_deadline = $now->clone->subtract( hours => 72 ); my $deletion_deadline = $now->clone->subtract( hours => 72 );
my $old_deadline = $now->clone->subtract( years => 1 ); my $old_deadline = $now->clone->subtract( years => 1 );
my $old_notification_deadline = $now->clone->subtract( weeks => 4 ); my $old_notification_deadline = $now->clone->subtract( weeks => 4 );
my $db = $self->app->pg->db; my $db = $self->app->pg->db;
@ -93,6 +93,7 @@ sub run {
); );
for my $user ( $to_notify->hashes->each ) { for my $user ( $to_notify->hashes->each ) {
say "Sending account deletion notification to uid $user->{id}...";
$self->app->sendmail->age_deletion_notification( $self->app->sendmail->age_deletion_notification(
name => $user->{name}, name => $user->{name},
email => $user->{email}, email => $user->{email},