View | Details | Raw Unified | Return to bug 26854
Collapse All | Expand All

(-)a/tools/stage-marc-import.pl (-4 / +8 lines)
Lines 124-133 if ($completedJobID) { Link Here
124
            exit 0;
124
            exit 0;
125
        } elsif (defined $pid) {
125
        } elsif (defined $pid) {
126
            # child
126
            # child
127
            # close STDOUT to signal to Apache that
127
            # close STDOUT/STDERR to signal to end CGI session with Apache
128
            # we're now running in the background
128
            # Otherwise, the AJAX request to this script won't return properly
129
            close STDOUT;
129
            close STDOUT;
130
            # close STDERR; # there is no good reason to close STDERR
130
            close STDERR;
131
            my $logdir = C4::Context->config('logdir');
132
            if ($logdir && -d $logdir){
133
                my $logfile = sprintf("%s/%s",$logdir,'background-jobs.log');
134
                open(STDERR, '>>', $logfile);
135
            }
131
        } else {
136
        } else {
132
            # fork failed, so exit immediately
137
            # fork failed, so exit immediately
133
            warn "fork failed while attempting to run tools/stage-marc-import.pl as a background job: $!";
138
            warn "fork failed while attempting to run tools/stage-marc-import.pl as a background job: $!";
134
- 

Return to bug 26854