From 2a37a53b80b504c2eba355b1dde3a8e061b6b744 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 3 Jun 2010 00:11:18 +0200 Subject: [PATCH] sync storable mtime on first dump --- lib/MojoFacets/Data.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/MojoFacets/Data.pm b/lib/MojoFacets/Data.pm index d767ce0..8f70aac 100644 --- a/lib/MojoFacets/Data.pm +++ b/lib/MojoFacets/Data.pm @@ -68,13 +68,16 @@ sub _save { my ( $self, $path ) = @_; my $dump_path = $self->_dump_path( $path ); + my $first_load = ! -e $dump_path; warn "save loaded to $dump_path"; my $info = $loaded->{$path}; store $info, $dump_path; - # sync timestamp - #my $mtime = $loaded->{$path}->{mtime}; - #utime $mtime, $mtime, $dump_path; + if ( $first_load ) { + my $mtime = $loaded->{$path}->{mtime}; + utime $mtime, $mtime, $dump_path; + warn "sync time to $path at $mtime\n"; + } warn $dump_path, ' ', -s $dump_path, " bytes\n"; return $dump_path; -- 2.20.1