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

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

Return to bug 26854