From b7f13e0748e2cac5b50455ed511e967d348c0564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Fri, 10 Apr 2015 08:44:39 +0200 Subject: [PATCH] Bug 13606 Clear job data in session when the job is completed To test: - Batch modify a large set of biblio records - During the modification process, do some SELECT in the session table. You will see the Job data increasing. - At the end of the process, do a last SELECT: job data has disappear. --- C4/BackgroundJob.pm | 19 +++++++++++++++++++ tools/batch_record_modification.pl | 1 + 2 files changed, 20 insertions(+) diff --git a/C4/BackgroundJob.pm b/C4/BackgroundJob.pm index 3ab5125..c0a8dc4 100644 --- a/C4/BackgroundJob.pm +++ b/C4/BackgroundJob.pm @@ -300,6 +300,25 @@ sub get { return $self->{extra_values}->{$key}; } + +=head2 clear + +=over 4 + +=item $job->clear(); + +=back + +Clear the job from the current session. + +=cut + +sub clear { + my $self = shift; + get_session($self->{sessionID})->clear('job_' . $self->{jobID}); +} + + 1; __END__ diff --git a/tools/batch_record_modification.pl b/tools/batch_record_modification.pl index beb2b4c..f275088 100755 --- a/tools/batch_record_modification.pl +++ b/tools/batch_record_modification.pl @@ -62,6 +62,7 @@ if ( $completedJobID ) { view => 'report', ); output_html_with_http_headers $input, $cookie, $template->output; + $job->clear(); exit; } -- 2.3.5