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

(-)a/misc/migration_tools/rebuild_zebra.pl (-7 / +6 lines)
Lines 146-152 my ($biblioitemnumbertagfield,$biblioitemnumbertagsubfield) = &GetMarcFromKohaFi Link Here
146
my $lockdir = C4::Context->config("lockdir");
146
my $lockdir = C4::Context->config("lockdir");
147
$lockdir = "/var/lock" if $lockdir == "";
147
$lockdir = "/var/lock" if $lockdir == "";
148
$lockdir .= ("/koha_rebuild_zebra_" . C4::Context->config("database"));
148
$lockdir .= ("/koha_rebuild_zebra_" . C4::Context->config("database"));
149
mkpath($lockdir, 0, 0755) unless (-d $lockdir);
149
mkpath($lockdir, 0, oct(755)) unless (-d $lockdir);
150
my $lockfile = $lockdir . "/lock";
150
my $lockfile = $lockdir . "/lock";
151
151
152
if ( $verbose_logging ) {
152
if ( $verbose_logging ) {
Lines 173-186 my $tester = XML::LibXML->new(); Link Here
173
# record being overwritten by a rebuild if the update is applied after the export
173
# record being overwritten by a rebuild if the update is applied after the export
174
# by the rebuild and before the rebuild finishes (more likely to effect large
174
# by the rebuild and before the rebuild finishes (more likely to effect large
175
# catalogs).
175
# catalogs).
176
open(LockFH, ">$lockfile") or die "$lockfile: $!";
176
open my $LockFH, q{>}, $lockfile or die "$lockfile: $!";
177
if ($daemon_mode) {
177
if ($daemon_mode) {
178
    while (1) {
178
    while (1) {
179
        # For incremental updates, skip the update if the updates are locked
179
        # For incremental updates, skip the update if the updates are locked
180
	if (flock(LockFH, LOCK_EX|LOCK_NB)) {
180
        if (flock(LockFH, LOCK_EX|LOCK_NB)) {
181
	    do_one_pass() if ( zebraqueue_not_empty() );
181
            do_one_pass() if ( zebraqueue_not_empty() );
182
	    flock(LockFH, LOCK_UN);
182
            flock(LockFH, LOCK_UN);
183
	}
183
        }
184
        sleep $daemon_sleep;
184
        sleep $daemon_sleep;
185
    }
185
    }
186
} else {
186
} else {
187
- 

Return to bug 11078