/[webpac2]/trunk/lib/WebPAC/Store.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Store.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 735 by dpavlin, Mon Oct 2 09:31:25 2006 UTC revision 853 by dpavlin, Sun May 27 14:09:30 2007 UTC
# Line 229  sub save_ds { Line 229  sub save_ds {
229          my $args = {@_};          my $args = {@_};
230    
231          my $log = $self->_get_logger;          my $log = $self->_get_logger;
232          $log->debug("save_ds arguments:", dump( \@_ ));          $log->debug("save_ds arguments:", sub { dump( \@_ ) });
233    
234          foreach my $f (qw/id ds/) {          foreach my $f (qw/id ds/) {
235                  $log->logconfess("need $f") unless (defined($args->{$f}));                  $log->logconfess("need $f") unless (defined($args->{$f}));
# Line 285  sub load_lookup { Line 285  sub load_lookup {
285          my $path = $self->{path} . "/lookup/$database/" . $args->{input} . '/' . $args->{key};          my $path = $self->{path} . "/lookup/$database/" . $args->{input} . '/' . $args->{key};
286    
287          if (! -e $path) {          if (! -e $path) {
288                  $log->warn("lookup $path doesn't exist, skipping");                  $log->error("lookup $path doesn't exist, lookups will be disabled. Try re-indexing $database/", $args->{input});
289                  return;                  return;
290          }          }
291    
# Line 331  sub save_lookup { Line 331  sub save_lookup {
331    
332          $path .= "/" . $args->{key};          $path .= "/" . $args->{key};
333    
334            my $t = time();
335    
336          if (store $args->{data}, $path) {          if (store $args->{data}, $path) {
337                  $log->info("saved lookup $path");                  $log->info(sprintf("saved lookup $path in %.2fs", time() - $t));
338                  return 1;                  return 1;
339          } else {          } else {
340                  $log->logwarn("can't save lookup to $path: $!");                  $log->logwarn("can't save lookup to $path: $!");

Legend:
Removed from v.735  
changed lines
  Added in v.853

  ViewVC Help
Powered by ViewVC 1.1.26