projects
/
MojoFacets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f604318
)
reload file if changed
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 27 May 2010 16:05:07 +0000
(18:05 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 27 May 2010 16:05:07 +0000
(18:05 +0200)
lib/MojoFacets/Data.pm
patch
|
blob
|
history
diff --git
a/lib/MojoFacets/Data.pm
b/lib/MojoFacets/Data.pm
index
d37910b
..
6286671
100644
(file)
--- a/
lib/MojoFacets/Data.pm
+++ b/
lib/MojoFacets/Data.pm
@@
-75,14
+75,13
@@
sub _load_path {
my $full_path = $self->app->home->rel_file( 'data/' . $path );
die "$full_path $!" unless -r $full_path;
my $full_path = $self->app->home->rel_file( 'data/' . $path );
die "$full_path $!" unless -r $full_path;
+ my $dump_path = $self->_dump_path( $path );
+
if ( defined $loaded->{$path}->{data} ) {
my $mtime = (stat($full_path))[9];
return if $loaded->{$path}->{mtime} == $mtime;
warn "reload $full_path, modified ", time() - $mtime, " seconds ago\n";
if ( defined $loaded->{$path}->{data} ) {
my $mtime = (stat($full_path))[9];
return if $loaded->{$path}->{mtime} == $mtime;
warn "reload $full_path, modified ", time() - $mtime, " seconds ago\n";
- }
-
- my $dump_path = $self->_dump_path( $path );
- if ( -e $dump_path ) {
+ } elsif ( -e $dump_path ) {
warn "dump_path $dump_path ", -s $dump_path, " bytes loading...\n";
my $info = retrieve $dump_path;
$loaded->{ $path } = $info;
warn "dump_path $dump_path ", -s $dump_path, " bytes loading...\n";
my $info = retrieve $dump_path;
$loaded->{ $path } = $info;