Fix cron tasks bug
- upload_dir had no default value in cleanfiles task - upload_dir was not used in watch task
This commit is contained in:
parent
a729d505af
commit
7efebff4bf
|
@ -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
|
||||
|
||||
|
|
|
@ -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}.")";
|
||||
|
|
Loading…
Reference in New Issue