From 7efebff4bfa3722796a80a783fb332d6e50d41de Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sep 18 2017 06:53:50 +0000 Subject: Fix cron tasks bug - upload_dir had no default value in cleanfiles task - upload_dir was not used in watch task --- diff --git a/CHANGELOG b/CHANGELOG index b7e2c57..2c9740b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ Revision history for Lufi +0.02.2 2017-09-18 + - Fix cron tasks bug + 0.02.1 2017-09-14 - Fix DB abstraction layer bug diff --git a/lib/Lufi/Command/cron/cleanfiles.pm b/lib/Lufi/Command/cron/cleanfiles.pm index c9d0ba0..721e2ad 100644 --- a/lib/Lufi/Command/cron/cleanfiles.pm +++ b/lib/Lufi/Command/cron/cleanfiles.pm @@ -20,7 +20,8 @@ sub run { my $config = $c->app->plugin('Config', { file => $cfile, default => { - dbtype => 'sqlite', + dbtype => 'sqlite', + upload_dir => 'files', } }); diff --git a/lib/Lufi/Command/cron/watch.pm b/lib/Lufi/Command/cron/watch.pm index af4134e..8d31ce6 100644 --- a/lib/Lufi/Command/cron/watch.pm +++ b/lib/Lufi/Command/cron/watch.pm @@ -22,12 +22,13 @@ sub run { file => $cfile, default => { dbtype => 'sqlite', + upload_dir => 'files', policy_when_full => 'warn' } }); if (defined($config->{max_total_size})) { - my $total = du(qw/files/); + my $total = du(($c->app->config('upload_dir'))); if ($total > $config->{max_total_size}) { say "[Lufi cron job watch] Files directory is over quota ($total > ".$config->{max_total_size}.")";