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

(-)a/misc/migration_tools/rebuild_zebra.pl (-2 / +9 lines)
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 63-68 my $run_user = (getpwuid($<))[0]; Link Here
63
my $wait_for_lock = 0;
64
my $wait_for_lock = 0;
64
my $use_flock;
65
my $use_flock;
65
my $table = 'biblioitems';
66
my $table = 'biblioitems';
67
my $is_memcached = Koha::Caches->get_instance('syspref')->memcached_cache;
66
68
67
my $verbose_logging = 0;
69
my $verbose_logging = 0;
68
my $zebraidx_log_opt = " -v none,fatal,warn ";
70
my $zebraidx_log_opt = " -v none,fatal,warn ";
Lines 136-141 if ($daemon_mode) { Link Here
136
        $msg   .= "Please do '$0 --help' to see usage.\n";
138
        $msg   .= "Please do '$0 --help' to see usage.\n";
137
        die $msg;
139
        die $msg;
138
    }
140
    }
141
    unless ($is_memcached) {
142
        warn "Warning: script running in daemon mode, without recommended caching system (memcached).\n";
143
    }
139
    $authorities = 1;
144
    $authorities = 1;
140
    $biblios = 1;
145
    $biblios = 1;
141
    $process_zebraqueue = 1;
146
    $process_zebraqueue = 1;
Lines 243-249 if ($daemon_mode) { Link Here
243
    while (1) {
248
    while (1) {
244
        # For incremental updates, skip the update if the updates are locked
249
        # For incremental updates, skip the update if the updates are locked
245
        if (_flock($LockFH, LOCK_EX|LOCK_NB)) {
250
        if (_flock($LockFH, LOCK_EX|LOCK_NB)) {
246
            do_one_pass() if ( zebraqueue_not_empty() );
251
            if ( zebraqueue_not_empty() ) {
252
                Koha::Caches->flush_L1_caches() if ($is_memcached);
253
                do_one_pass();
254
            }
247
            _flock($LockFH, LOCK_UN);
255
            _flock($LockFH, LOCK_UN);
248
        }
256
        }
249
        sleep $daemon_sleep;
257
        sleep $daemon_sleep;
250
- 

Return to bug 16758