Add option to cleanup_database script to removed 'resolved' return claims from the database after a specified number of days.
Maybe put the number of days in a syspref, make the cron check the syspref when run?
(In reply to Andrew Fuerste-Henry from comment #1) > Maybe put the number of days in a syspref, make the cron check the syspref > when run? +1
Created attachment 104611 [details] [review] 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
Created attachment 104612 [details] [review] Bug 25429: Fix typos, correct spacing, add missing periods for script help
Hi Kyle, did you see comments #1 and #2? I think it would be really great if we could have this as a system preference - it would make things much easier with multiple instances on a server.
Created attachment 104798 [details] [review] Bug 25429: Implement system preference, remove command line switch
Kyle, can you please rebase this? Thanks!
Created attachment 114601 [details] [review] 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
Created attachment 114602 [details] [review] Bug 25429: Implement system preference, remove command line switch
After applying this patch, I get the error "unknown option: return-claims" when I run "perl misc/cronjobs/cleanup_database.pl --return-claims 40 --confirm"
Created attachment 115042 [details] [review] 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) Set the new syspref CleanUpDatabaseReturnClaims to a number of days 3) Run cleanup_database.pl 4) Note resolved claims older than the specified number of days are removed from the database Bug 25429: Implement system preference, remove command line switch
Can we make the cron require a --claims flag or something comparable? It seems likely to create confusion down the line to have this cron perform an action based on a syspref value without some obvious indicator in the cron line itself. Additionally, as it is now I am unable to remove resolved claims without *also* doing something else with the cron. If I run this with just "--confirm," the cron just spits out the help text and wants me to try again with something actually set. Not that anyone's likely to be running this with no other flags, but it's a confusion easily avoided.
(In reply to Andrew Fuerste-Henry from comment #12) > Can we make the cron require a --claims flag or something comparable? It > seems likely to create confusion down the line to have this cron perform an > action based on a syspref value without some obvious indicator in the cron > line itself. > > Additionally, as it is now I am unable to remove resolved claims without > *also* doing something else with the cron. If I run this with just > "--confirm," the cron just spits out the help text and wants me to try again > with something actually set. Not that anyone's likely to be running this > with no other flags, but it's a confusion easily avoided. I don't understand the purpose of moving the value to a syspref if it still requires a cli flag to run.
Created attachment 115086 [details] [review] Bug 25429: Script should be able to run with only return claims
Created attachment 115087 [details] [review] 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) Set the new syspref CleanUpDatabaseReturnClaims to a number of days 3) Run cleanup_database.pl 4) Note resolved claims older than the specified number of days are removed from the database Bug 25429: Implement system preference, remove command line switch
Created attachment 115088 [details] [review] Bug 25429: Script should be able to run with only return claims
Created attachment 115089 [details] [review] 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) Set the new syspref CleanUpDatabaseReturnClaims to a number of days 3) Run cleanup_database.pl 4) Note resolved claims older than the specified number of days are removed from the database Bug 25429: Implement system preference, remove command line switch Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 115090 [details] [review] Bug 25429: Script should be able to run with only return claims Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>