Bugzilla – Attachment 104611 Details for
Bug 25429
`cleanup_database.pl` should remove resolved claims returned after X days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25429: Cleanup Database - remove resolved claims returned from db after X days
Bug-25429-Cleanup-Database---remove-resolved-claim.patch (text/plain), 2.86 KB, created by
Kyle M Hall (khall)
on 2020-05-08 18:09:20 UTC
(
hide
)
Description:
Bug 25429: Cleanup Database - remove resolved claims returned from db after X days
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-05-08 18:09:20 UTC
Size:
2.86 KB
patch
obsolete
>From 5c187d3118641971ee52a1495f1eb0a2b1dfd125 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 8 May 2020 14:02:34 -0400 >Subject: [PATCH] Bug 25429: Cleanup Database - remove resolved claims returned > from db after X days > >Add option to cleanup_database script to removed 'resolved' return claims from the database after a specified number of days. > >Test Plan: >1) Apply this patch >2) Test cleanup_database with the new --return-claims DAYS option >--- > misc/cronjobs/cleanup_database.pl | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index a1a9cae442..57b9754ca1 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -75,7 +75,8 @@ Usage: $0 [-h|--help] [--sessions] [--sessdays DAYS] [-v|--verbose] [--zebraqueu > days. Defaults to 14 days if no days specified. > --restrictions DAYS purge patrons restrictions expired since more than DAYS days. > Defaults to 30 days if no days specified. >- --all-restrictions purge all expired patrons restrictions. >+ --all-restrictions purge all expired patrons restrictions. >+ --return-claims DAYS Purge all resolved return claims older than DAYS > --del-exp-selfreg Delete expired self registration accounts > --del-unv-selfreg DAYS Delete unverified self registrations older than DAYS > --unique-holidays DAYS Delete all unique holidays older than DAYS >@@ -108,6 +109,7 @@ my $pZ3950; > my $pListShareInvites; > my $pDebarments; > my $allDebarments; >+my $return_claims; > my $pExpSelfReg; > my $pUnvSelfReg; > my $fees_days; >@@ -139,6 +141,7 @@ GetOptions( > 'list-invites:i' => \$pListShareInvites, > 'restrictions:i' => \$pDebarments, > 'all-restrictions' => \$allDebarments, >+ 'return-claims:i' => \$return_claims, > 'del-exp-selfreg' => \$pExpSelfReg, > 'del-unv-selfreg' => \$pUnvSelfReg, > 'unique-holidays:i' => \$special_holidays_days, >@@ -192,6 +195,7 @@ unless ( $sessions > || $pOldIssues > || $pOldReserves > || $pTransfers >+ || $return_claims > ) { > print "You did not specify any cleanup work for the script to do.\n\n"; > usage(1); >@@ -405,6 +409,18 @@ if ($pStatistics) { > print "Done with purging statistics.\n" if $verbose; > } > >+if ($return_claims) { >+ print "Purging return claims older than $return_claims days.\n" if $verbose; >+ $sth = $dbh->prepare( >+ q{ >+ DELETE FROM return_claims >+ WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY) >+ } >+ ); >+ $sth->execute($return_claims); >+ print "Done with purging return claims.\n" if $verbose; >+} >+ > if ($pDeletedCatalog) { > print "Purging deleted catalog older than $pDeletedCatalog days.\n" if $verbose; > my $sth1 = $dbh->prepare( >-- >2.24.2 (Apple Git-127)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 25429
:
104611
|
104612
|
104798
|
114601
|
114602
|
115042
|
115086
|
115087
|
115088
|
115089
|
115090
|
115907
|
115908
|
118880
|
118881
|
119219
|
120927
|
120928
|
120929
|
120930
|
125584
|
125585
|
125586
|
125587
|
125588