|
Lines 73-78
my ( $help, @queues );
Link Here
|
| 73 |
my $max_processes = $ENV{MAX_PROCESSES}; |
73 |
my $max_processes = $ENV{MAX_PROCESSES}; |
| 74 |
$max_processes ||= C4::Context->config('background_jobs_worker')->{max_processes} if C4::Context->config('background_jobs_worker'); |
74 |
$max_processes ||= C4::Context->config('background_jobs_worker')->{max_processes} if C4::Context->config('background_jobs_worker'); |
| 75 |
$max_processes ||= 1; |
75 |
$max_processes ||= 1; |
|
|
76 |
my $mq_timeout = $ENV{MQ_TIMEOUT} // 10; |
| 76 |
|
77 |
|
| 77 |
my $not_found_retries = {}; |
78 |
my $not_found_retries = {}; |
| 78 |
my $max_retries = $ENV{MAX_RETRIES} || 10; |
79 |
my $max_retries = $ENV{MAX_RETRIES} || 10; |
|
Lines 114-122
if ( $conn ) {
Link Here
|
| 114 |
} |
115 |
} |
| 115 |
while (1) { |
116 |
while (1) { |
| 116 |
if ( $conn ) { |
117 |
if ( $conn ) { |
| 117 |
my $frame = $conn->receive_frame; |
118 |
my $frame = $conn->receive_frame( { timeout => $mq_timeout } ); |
| 118 |
if ( !defined $frame ) { |
119 |
if ( !defined $frame ) { |
| 119 |
# maybe log connection problems |
120 |
# timeout or connection issue? |
|
|
121 |
$pm->reap_finished_children; |
| 120 |
next; # will reconnect automatically |
122 |
next; # will reconnect automatically |
| 121 |
} |
123 |
} |
| 122 |
|
124 |
|
| 123 |
- |
|
|