diff --git a/lib/LDV/Imgbin.pm b/lib/LDV/Imgbin.pm index a87009c..abaa92d 100644 --- a/lib/LDV/Imgbin.pm +++ b/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;