🐛 — Make the provisioning task even if there is no $ENV{MOJO_CONFIG}

This commit is contained in:
Luc Didry 2020-07-19 18:48:22 +02:00
parent 222fe59ebc
commit 5e248e06ac
No known key found for this signature in database
GPG Key ID: EA868E12D0257E3C
1 changed files with 2 additions and 1 deletions

View File

@ -74,10 +74,11 @@ sub startup {
}
# Recurrent task
my $config_file = $ENV{MOJO_CONFIG} || $self->moniker.'.conf';
Mojo::IOLoop->recurring(2 => sub {
my $loop = shift;
my $lockfile = Mojo::File->new($ENV{MOJO_CONFIG})->basename('.conf').'-provisioning.lock';
my $lockfile = Mojo::File->new($config_file)->basename('.conf').'-provisioning.lock';
if (-e $lockfile) {
my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($lockfile);