Lines 2930-2956
sub ModZebra {
Link Here
|
2930 |
else { |
2930 |
else { |
2931 |
croak "ModZebra called with unknown operation: $op"; |
2931 |
croak "ModZebra called with unknown operation: $op"; |
2932 |
} |
2932 |
} |
2933 |
} else { |
2933 |
} |
2934 |
my $dbh = C4::Context->dbh; |
2934 |
|
2935 |
|
2935 |
my $dbh = C4::Context->dbh; |
2936 |
# true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates |
2936 |
|
2937 |
# at the same time |
2937 |
# true ModZebra commented until indexdata fixes zebraDB crashes (it seems they occur on multiple updates |
2938 |
# replaced by a zebraqueue table, that is filled with ModZebra to run. |
2938 |
# at the same time |
2939 |
# the table is emptied by rebuild_zebra.pl script (using the -z switch) |
2939 |
# replaced by a zebraqueue table, that is filled with ModZebra to run. |
2940 |
my $check_sql = "SELECT COUNT(*) FROM zebraqueue |
2940 |
# the table is emptied by rebuild_zebra.pl script (using the -z switch) |
2941 |
WHERE server = ? |
2941 |
my $check_sql = "SELECT COUNT(*) FROM zebraqueue |
2942 |
AND biblio_auth_number = ? |
2942 |
WHERE server = ? |
2943 |
AND operation = ? |
2943 |
AND biblio_auth_number = ? |
2944 |
AND done = 0"; |
2944 |
AND operation = ? |
2945 |
my $check_sth = $dbh->prepare_cached($check_sql); |
2945 |
AND done = 0"; |
2946 |
$check_sth->execute( $server, $biblionumber, $op ); |
2946 |
my $check_sth = $dbh->prepare_cached($check_sql); |
2947 |
my ($count) = $check_sth->fetchrow_array; |
2947 |
$check_sth->execute( $server, $biblionumber, $op ); |
2948 |
$check_sth->finish(); |
2948 |
my ($count) = $check_sth->fetchrow_array; |
2949 |
if ( $count == 0 ) { |
2949 |
$check_sth->finish(); |
2950 |
my $sth = $dbh->prepare("INSERT INTO zebraqueue (biblio_auth_number,server,operation) VALUES(?,?,?)"); |
2950 |
if ( $count == 0 ) { |
2951 |
$sth->execute( $biblionumber, $server, $op ); |
2951 |
my $sth = $dbh->prepare("INSERT INTO zebraqueue (biblio_auth_number,server,operation) VALUES(?,?,?)"); |
2952 |
$sth->finish; |
2952 |
$sth->execute( $biblionumber, $server, $op ); |
2953 |
} |
2953 |
$sth->finish; |
2954 |
} |
2954 |
} |
2955 |
} |
2955 |
} |
2956 |
|
2956 |
|
2957 |
- |
|
|