Browse Source

* fix imgbin prune

master
Alex 'AdUser' Z 9 years ago
parent
commit
8afab71e31
  1. 4
      lib/LDV/Imgbin.pm

4
lib/LDV/Imgbin.pm

@ -160,9 +160,11 @@ sub prune {
my $now = time();
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);
next if $image->{expire} > $now;
unlink $path;
unlink $self->_image_path($time, $image->{format}, 1);
unlink $self->_thumb_path($time);
} 1;

Loading…
Cancel
Save