X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=misc%2Fcronjobs%2Fservices_throttle.pl;h=cafc5171cf9a6cdd173208b3374ae9d0b215cd43;hb=9226ae46419a5c54447c7d6e27b6163d2c6fd95a;hp=0d0d6be446d9a0dee2be5fc73269aa83445b4db0;hpb=d579648df109eef4d807e5e29602b9710b8193bf;p=koha.git diff --git a/misc/cronjobs/services_throttle.pl b/misc/cronjobs/services_throttle.pl index 0d0d6be446..cafc5171cf 100755 --- a/misc/cronjobs/services_throttle.pl +++ b/misc/cronjobs/services_throttle.pl @@ -1,7 +1,9 @@ #!/usr/bin/perl -#run nightly -- resets the services throttle +# run nightly -- resets the xisbn services throttle + +use strict; +use warnings; -use strict; use warnings; BEGIN { # find Koha's Perl modules # test carefully before changing this @@ -10,9 +12,10 @@ BEGIN { } use C4::Context; -my $dbh=C4::Context->dbh; my $fixit="UPDATE services_throttle SET service_count=0 WHERE service_type='xisbn'"; -my $sth=$dbh->prepare($fixit); -my $res = $sth->execute() or die "can't execute"; -print "$res\n"; #did it work? -$dbh->disconnect(); +my $sth = C4::Context->dbh->prepare($fixit); +my $res = $sth->execute() or die "cannot execute query: $fixit"; + +# There is no need to return anything if we succeeded, +# and the die message (or other more internal Context/mysql error) +# will get emailed to the cron user if we didn't.