From 95e0ed6179226de5e1e18d5381ac978e96d19406 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 9 Sep 2024 13:47:40 +0000 Subject: [PATCH] Bug 37552: (24.05.x) Wrap auto renewal attempt in eval to ensure script does not die Signed-off-by: Lucas Gass (cherry picked from commit 13c6a4a1bb936dbdb60a845cf82873719e1a433c) Signed-off-by: Fridolin Somers --- misc/cronjobs/automatic_renewals.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl index 30d8e94693..3b46c93714 100755 --- a/misc/cronjobs/automatic_renewals.pl +++ b/misc/cronjobs/automatic_renewals.pl @@ -170,7 +170,13 @@ while ( my $auto_renew = $auto_renews->next ) { $wants_digest = 0; } - my ( $success, $error, $updated ) = $auto_renew->attempt_auto_renew( { confirm => $confirm } ); + my ( $success, $error, $updated ); + eval { ( $success, $error, $updated ) = $auto_renew->attempt_auto_renew( { confirm => $confirm } ); }; + if ($@) { + print "An error was encountered in processing auto renewal for issue id: " . $auto_renew->issue_id . "\n"; + print "$@ \n"; + next; + } if ($success) { if ($verbose) { say sprintf "Issue id: %s for borrower: %s and item: %s %s be renewed.", -- 2.39.5