[Koha-cvs] CVS: koha/acqui.simple processz3950queue,1.3.2.7,1.3.2.8

Steve Tonnesen tonnesen at users.sourceforge.net
Mon Dec 9 18:53:12 CET 2002


Update of /cvsroot/koha/koha/acqui.simple
In directory sc8-pr-cvs1:/tmp/cvs-serv28779

Modified Files:
      Tag: rel-1-2
	processz3950queue 
Log Message:
Better handling of stuck z39.50 queries


Index: processz3950queue
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/Attic/processz3950queue,v
retrieving revision 1.3.2.7
retrieving revision 1.3.2.8
diff -C2 -r1.3.2.7 -r1.3.2.8
*** processz3950queue	4 Dec 2002 17:50:10 -0000	1.3.2.7
--- processz3950queue	9 Dec 2002 17:53:10 -0000	1.3.2.8
***************
*** 124,127 ****
--- 124,128 ----
  				my $stj=$dbi->prepare("select id from z3950results where server=$q_serverinfo and queryid=$id");
  				$stj->execute;
+ 				exit if $dbi->err;
  				($resultsid) = $stj->fetchrow;
  			    } else {
***************
*** 255,258 ****
--- 256,270 ----
  	}
  	sleep 10;
+ 	my $sth=$dbh->prepare("select id,startdate from z3950results where isnull(enddate)");
+ 	$sth->execute;
+ 	if ($sth->rows) {
+ 	    $checkqueue=1;
+ 	}
+ 	my $now=time();
+ 	while (my ($id, $startdate) = $sth->fetchrow) {
+ 	    if ($now-$startdate>1200) {
+ 		my $sti=$dbh->do("update z3950results set enddate=$now where id=$id");
+ 	    }
+ 	}
      }
  }





More information about the Koha-cvs mailing list