Commit 7efebff4 authored by Luc Didry's avatar Luc Didry

Fix cron tasks bug

- upload_dir had no default value in cleanfiles task
- upload_dir was not used in watch task
parent a729d505
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
......
......@@ -20,7 +20,8 @@ sub run {
my $config = $c->app->plugin('Config', {
file => $cfile,
default => {
dbtype => 'sqlite',
dbtype => 'sqlite',
upload_dir => 'files',
}
});
......
......@@ -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}.")";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment