[BACK]Return to test_server.pl CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / script

Diff for /HOPE/Net-OpenAMD/script/test_server.pl between version 1.2 and 1.3

version 1.2, 2010/06/25 21:20:15 version 1.3, 2010/06/26 17:14:52
Line 11 
Line 11 
     action => sub {      action => sub {
         my ( $self, $action ) = @_;          my ( $self, $action ) = @_;
   
         state $Actions = {          state %Actions;
             location  => { mtime => 0 },  
             speakers  => { mtime => 0 },  
             talks     => { mtime => 0 },  
             interests => { mtime => 0 },  
             users     => { mtime => 0 },  
         };  
         return if !exists $Actions->{$action};  
   
         my $path  = app->home->rel_file( 'data/' . $action );          my $path  = app->home->rel_file( 'data/' . $action );
         my $mtime = ( stat $path )[9];  
   
         if ( $mtime != $Actions->{$action}{mtime} ) {          return if ! -e $path;
           my $mtime = ( stat _ )[9];
   
           $Actions{$action}{mtime} //= 0;
   
           if ( $mtime != $Actions{$action}{mtime} ) {
             open my $fh, $path or die "Couldn't open [$path]: $!";              open my $fh, $path or die "Couldn't open [$path]: $!";
             my $content = do { local $/; <$fh> };              my $content = do { local $/; <$fh> };
             close $fh;              close $fh;
Line 34 
Line 31 
                 die $json->error;                  die $json->error;
             }              }
   
             $Actions->{$action} = {              $Actions{$action} = {
                 mtime => $mtime,                  mtime => $mtime,
                 data  => $data,                  data  => $data,
             };              };
         }          }
   
         return $Actions->{$action}{data};          return $Actions{$action}{data};
     }      }
 );  );
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>