Lines 26-31
use C4::Biblio;
Link Here
|
26 |
use C4::AuthoritiesMarc; |
26 |
use C4::AuthoritiesMarc; |
27 |
use C4::Items; |
27 |
use C4::Items; |
28 |
use Koha::RecordProcessor; |
28 |
use Koha::RecordProcessor; |
|
|
29 |
use Koha::Caches; |
29 |
use XML::LibXML; |
30 |
use XML::LibXML; |
30 |
|
31 |
|
31 |
use constant LOCK_FILENAME => 'rebuild..LCK'; |
32 |
use constant LOCK_FILENAME => 'rebuild..LCK'; |
Lines 62-67
my $run_user = (getpwuid($<))[0];
Link Here
|
62 |
my $wait_for_lock = 0; |
63 |
my $wait_for_lock = 0; |
63 |
my $use_flock; |
64 |
my $use_flock; |
64 |
my $table = 'biblioitems'; |
65 |
my $table = 'biblioitems'; |
|
|
66 |
my $is_memcached = Koha::Caches->get_instance('syspref')->memcached_cache; |
65 |
|
67 |
|
66 |
my $verbose_logging = 0; |
68 |
my $verbose_logging = 0; |
67 |
my $zebraidx_log_opt = " -v none,fatal,warn "; |
69 |
my $zebraidx_log_opt = " -v none,fatal,warn "; |
Lines 128-133
if ($daemon_mode) {
Link Here
|
128 |
$msg .= "Please do '$0 --help' to see usage.\n"; |
130 |
$msg .= "Please do '$0 --help' to see usage.\n"; |
129 |
die $msg; |
131 |
die $msg; |
130 |
} |
132 |
} |
|
|
133 |
unless ($is_memcached) { |
134 |
warn "Warning: script running in daemon mode, without recommended caching system (memcached).\n"; |
135 |
} |
131 |
$authorities = 1; |
136 |
$authorities = 1; |
132 |
$biblios = 1; |
137 |
$biblios = 1; |
133 |
$process_zebraqueue = 1; |
138 |
$process_zebraqueue = 1; |
Lines 237-243
if ($daemon_mode) {
Link Here
|
237 |
if (_flock($LockFH, LOCK_EX|LOCK_NB)) { |
242 |
if (_flock($LockFH, LOCK_EX|LOCK_NB)) { |
238 |
eval { |
243 |
eval { |
239 |
$dbh = C4::Context->dbh; |
244 |
$dbh = C4::Context->dbh; |
240 |
do_one_pass() if ( zebraqueue_not_empty() ); |
245 |
if( zebraqueue_not_empty() ) { |
|
|
246 |
Koha::Caches->flush_L1_caches() if $is_memcached; |
247 |
do_one_pass(); |
248 |
} |
241 |
}; |
249 |
}; |
242 |
if ($@ && $verbose_logging) { |
250 |
if ($@ && $verbose_logging) { |
243 |
warn "Warning : $@\n"; |
251 |
warn "Warning : $@\n"; |
244 |
- |
|
|