From 4a634069eec5efd1411bf5bd0bbdf6d161771532 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 11 Nov 2007 12:30:23 -0600 Subject: [PATCH] Couple of little fixes to the zebraqueue daemon Signed-off-by: Joshua Ferraro --- misc/cronjobs/zebraqueue_start.pl | 2 +- misc/zebraqueue_daemon.pl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/zebraqueue_start.pl b/misc/cronjobs/zebraqueue_start.pl index b79aeaaa45..3dd6029f91 100755 --- a/misc/cronjobs/zebraqueue_start.pl +++ b/misc/cronjobs/zebraqueue_start.pl @@ -25,7 +25,7 @@ my $readsth=$dbh->prepare("SELECT id,biblio_auth_number,operation,server FROM ze #AGAIN: #my $wait=C4::Context->preference('zebrawait') || 120; -my $verbose = 0; +my $verbose = 1; print "starting with verbose=$verbose\n" if $verbose; my ($id,$biblionumber,$operation,$server,$marcxml); diff --git a/misc/zebraqueue_daemon.pl b/misc/zebraqueue_daemon.pl index 80e4c2df86..7a9c8d5a44 100755 --- a/misc/zebraqueue_daemon.pl +++ b/misc/zebraqueue_daemon.pl @@ -51,7 +51,8 @@ sub handler_check { my $dbh=C4::Context->dbh; my $sth = $dbh->prepare("SELECT count(*) AS opcount FROM zebraqueue WHERE done = 0"); $sth->execute; - if (my $data = $sth->fetchrow_hashref()){ + my $data = $sth->fetchrow_hashref(); + if ($data->{'opcount'} > 0){ Unix::Syslog::syslog LOG_INFO, "$data->{'opcount'} operations waiting to be run\n"; $sth->finish(); $kernel->yield('do_ops'); @@ -87,7 +88,7 @@ sub zebraop { my $marc = GetMarcBiblio($data->{'biblio_auth_number'}); $marcxml = $marc->as_xml_record() if $marc; } - elsif ($data->{'server'} eq "authorityserver") { + elsif ($data->{'server'} eq "authorityserver") { $marcxml =C4::AuthoritiesMarc::GetAuthorityXML($data->{'biblio_auth_number'}); } # check it's XML, just in case @@ -119,7 +120,7 @@ sub zebraop { # this avoid indexing X+1 times where just 1 is enough. } else { $delsth =$dbh->prepare("UPDATE zebraqueue SET done=1 WHERE biblio_auth_number =? and operation='specialUpdate'"); - $delsth->execute($data->{'biblionumber'}); + $delsth->execute($data->{'biblio_auth_number'}); } } }; -- 2.39.5