Bugzilla – Attachment 161646 Details for
Bug 35948
cleanup_database.pl should remove not only finished background jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35948: cleanup_database.pl should remove not only finished background jobs
Bug-35948-cleanupdatabasepl-should-remove-not-only.patch (text/plain), 1.53 KB, created by
Fridolin Somers
on 2024-01-30 14:49:22 UTC
(
hide
)
Description:
Bug 35948: cleanup_database.pl should remove not only finished background jobs
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2024-01-30 14:49:22 UTC
Size:
1.53 KB
patch
obsolete
>From ac35b4a55a6e3dea3c8ffbdf3565fafc9bf03305 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 30 Jan 2024 15:40:29 +0100 >Subject: [PATCH] Bug 35948: cleanup_database.pl should remove not only > finished background jobs > >Bug 31969 changed cleanup_database.pl so it removes only finished background jobs. >But old background jobs with other statuses will never be removed. > >So we should use "enqueued_on" instead of "ended_on" >and no filter on status > >Test plan : >1) Create a background job with for example a batch item modification >2) Simulate ancien job via SQL : >update background_jobs set status='failed',enqueued_on=DATE_SUB(NOW(),INTERVAL 10 DAY) where id=X >3) Run misc/cronjobs/cleanup_database.pl --jobs-days 9 --jobs-type all -v --confirm >4) Check the job is removed >--- > misc/cronjobs/cleanup_database.pl | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index 04cc934b9c..663a1d07cf 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -744,12 +744,11 @@ if ($jobs_days) { > if $verbose; > my $jobs = Koha::BackgroundJobs->search( > { >- status => 'finished', > ( $jobs_types[0] eq 'all' ? () : ( type => \@jobs_types ) ) > } > )->filter_by_last_update( > { >- timestamp_column_name => 'ended_on', >+ timestamp_column_name => 'enqueued_on', > days => $jobs_days, > } > ); >-- >2.43.0
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 35948
: 161646