|
|
@ -160,9 +160,11 @@ sub prune { |
|
|
|
|
|
|
|
|
|
|
|
my $now = time(); |
|
|
|
my $now = time(); |
|
|
|
foreach my $time (@times) { |
|
|
|
foreach my $time (@times) { |
|
|
|
my $data = Mojo::Asset::File->new(path => $self->_data_path($time)); |
|
|
|
my $path = $self->_data_path($time); |
|
|
|
|
|
|
|
my $data = Mojo::Asset::File->new(path => $path); |
|
|
|
my $image = $self->app->json->decode($data->slurp); |
|
|
|
my $image = $self->app->json->decode($data->slurp); |
|
|
|
next if $image->{expire} > $now; |
|
|
|
next if $image->{expire} > $now; |
|
|
|
|
|
|
|
unlink $path; |
|
|
|
unlink $self->_image_path($time, $image->{format}, 1); |
|
|
|
unlink $self->_image_path($time, $image->{format}, 1); |
|
|
|
unlink $self->_thumb_path($time); |
|
|
|
unlink $self->_thumb_path($time); |
|
|
|
} 1; |
|
|
|
} 1; |
|
|
|