From 8afab71e31a05cd8e7eb937d68ee69d8dc22d8b0 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Fri, 5 Feb 2016 20:57:07 +1000 Subject: [PATCH] * fix imgbin prune --- lib/LDV/Imgbin.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;