JBAS-1037 Log patron purge count
authorBill Erickson <berickxx@gmail.com>
Fri, 8 Jan 2016 15:01:19 +0000 (07:01 -0800)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/import_students/generate-patrons-from-csv.pl

index 4ec47fb..25753c9 100755 (executable)
@@ -25,6 +25,7 @@ my $alert2_msg      = 'DO NOT MERGE OR EDIT. RECORD MANAGED CENTRALLY.';
 my $alert_type      = 20; # "Alerting note, no Blocks" standing penalty
 my $root_org        = 1; # KCLS org unit for penalty application
 my $expire_age      = 18; # Kent (for now) uses 21. 
+my $purge_count     = 0; # useful for local logging
 my $db_handle;
 my %new_barcodes;
 my @failures;       # one row per student account that failed for any reason
@@ -539,8 +540,11 @@ sub purge_patron {
                 if $err = $@;
         }
 
-        announce('DEBUG', "User $bc (ID $user_id) successfully purged") 
-            unless $err;
+        if (!$err) { # could be set directly above
+            $purge_count++;
+            announce('DEBUG', 
+                "User $bc (ID $user_id) [$purge_count] successfully purged");
+        }
     }
 }