diff --git a/CHANGELOG b/CHANGELOG index 78eaa3d..185a72e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Revision history for Lufi ?.??.? ????-??-?? + - 🔥 Remove code from abandonned feature + - Trying to fix the provisioning task 0.05.1 2020-06-30 - Update german translation diff --git a/lib/Lufi.pm b/lib/Lufi.pm index efeb40e..9daef2f 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -74,11 +74,21 @@ 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'; - return if -e $lockfile; + 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); + + # Remove the lockfile if more than 20 seconds old + if (time - $mtime > 20) { + unlink $lockfile if -e $lockfile; # if -e just to be sure the file hasn’t been removed while checking it + } else { + return; + } + } $lockfile = Mojo::File->new($lockfile)->touch(); diff --git a/lib/Lufi/Command/sqliteToOtherDB.pm b/lib/Lufi/Command/sqliteToOtherDB.pm index 0811357..13ed0b2 100644 --- a/lib/Lufi/Command/sqliteToOtherDB.pm +++ b/lib/Lufi/Command/sqliteToOtherDB.pm @@ -1,6 +1,5 @@ package Lufi::Command::sqliteToOtherDB; use Mojo::Base 'Mojolicious::Command'; -use Lufi::DB::BreakingChange; use Lufi::DB::File; use Lufi::DB::Slice; use Lufi::DB::Invitation; @@ -93,15 +92,6 @@ sub run { ->write(); $progress->update(); }); - $changes->each(sub { - my ($change, $num) = @_; - - Lufi::DB::BreakingChange->new(app => $c->app) - ->change($change->{change}) - ->ack($change->{ack}) - ->write(); - $progress->update(); - }); } =encoding utf8 diff --git a/themes/default/lib/Lufi/I18N/en.po b/themes/default/lib/Lufi/I18N/en.po index 384ee9e..a43b895 100644 --- a/themes/default/lib/Lufi/I18N/en.po +++ b/themes/default/lib/Lufi/I18N/en.po @@ -138,15 +138,15 @@ msgstr "Copy all links to clipboard" msgid "Copy to clipboard" msgstr "Copy to clipboard" -#: lib/Lufi/Controller/Files.pm:502 +#: lib/Lufi/Controller/Files.pm:501 msgid "Could not delete the file. You are not authenticated." msgstr "Could not delete the file. You are not authenticated." -#: lib/Lufi/Controller/Files.pm:484 +#: lib/Lufi/Controller/Files.pm:483 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "Could not find the file. Are you sure of the URL and the token?" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:394 msgid "Could not find the file. Are you sure of the URL?" msgstr "Could not find the file. Are you sure of the URL?" @@ -222,15 +222,15 @@ msgstr "Emails" msgid "Encrypting part XX1 of XX2" msgstr "Encrypting part XX1 of XX2" -#: lib/Lufi/Controller/Files.pm:284 +#: lib/Lufi/Controller/Files.pm:283 msgid "Error: the file existed but was deleted." msgstr "Error: the file existed but was deleted." -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:363 msgid "Error: the file has not been sent entirely." msgstr "Error: the file has not been sent entirely." -#: lib/Lufi/Controller/Files.pm:374 +#: lib/Lufi/Controller/Files.pm:373 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "Error: unable to find the file. Are you sure of your URL?" @@ -250,7 +250,7 @@ msgstr "Expires at" msgid "Export localStorage data" msgstr "Export localStorage data" -#: lib/Lufi/Controller/Files.pm:466 +#: lib/Lufi/Controller/Files.pm:465 msgid "File deleted" msgstr "File deleted" @@ -585,7 +585,7 @@ msgstr "The email subject can't be empty." msgid "The expiration delay (%1) is not between 1 and %2 days." msgstr "The expiration delay (%1) is not between 1 and %2 days." -#: lib/Lufi/Controller/Files.pm:463 +#: lib/Lufi/Controller/Files.pm:462 msgid "The file has already been deleted" msgstr "The file has already been deleted" @@ -640,11 +640,11 @@ msgstr "The mail has been sent." msgid "The original (and only for now) author is Luc Didry." msgstr "The original (and only for now) author is Luc Didry." -#: lib/Lufi/Controller/Files.pm:231 +#: lib/Lufi/Controller/Files.pm:230 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "The server was unable to find the file record to add your file part to. Please, contact the administrator." -#: lib/Lufi/Controller/Files.pm:290 +#: lib/Lufi/Controller/Files.pm:289 msgid "This file has been deactivated by the admins. Contact them to know why." msgstr "This file has been deactivated by the admins. Contact them to know why." @@ -674,17 +674,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "Unable to copy the link(s) to your clipboard" #. ($short) -#: lib/Lufi/Controller/Files.pm:434 +#: lib/Lufi/Controller/Files.pm:433 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." #. ($short) -#: lib/Lufi/Controller/Files.pm:424 +#: lib/Lufi/Controller/Files.pm:423 msgid "Unable to get counter for %1. The token is invalid." msgstr "Unable to get counter for %1. The token is invalid." #. ($short) -#: lib/Lufi/Controller/Files.pm:444 +#: lib/Lufi/Controller/Files.pm:443 msgid "Unable to get counter for %1. You are not authenticated." msgstr "Unable to get counter for %1. You are not authenticated." @@ -769,7 +769,7 @@ msgstr "Your browser does not have enough entropy to generate a strong encryptio msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "Your file is too big: %1 (maximum size allowed: %2)" -#: lib/Lufi/Controller/Files.pm:346 +#: lib/Lufi/Controller/Files.pm:345 msgid "Your password is not valid. Please refresh the page to retry." msgstr "Your password is not valid. Please refresh the page to retry." diff --git a/themes/default/lib/Lufi/I18N/lufi.pot b/themes/default/lib/Lufi/I18N/lufi.pot index 2d76014..b0dabbd 100644 --- a/themes/default/lib/Lufi/I18N/lufi.pot +++ b/themes/default/lib/Lufi/I18N/lufi.pot @@ -138,15 +138,15 @@ msgstr "" msgid "Copy to clipboard" msgstr "" -#: lib/Lufi/Controller/Files.pm:502 +#: lib/Lufi/Controller/Files.pm:501 msgid "Could not delete the file. You are not authenticated." msgstr "" -#: lib/Lufi/Controller/Files.pm:484 +#: lib/Lufi/Controller/Files.pm:483 msgid "Could not find the file. Are you sure of the URL and the token?" msgstr "" -#: lib/Lufi/Controller/Files.pm:395 +#: lib/Lufi/Controller/Files.pm:394 msgid "Could not find the file. Are you sure of the URL?" msgstr "" @@ -222,15 +222,15 @@ msgstr "" msgid "Encrypting part XX1 of XX2" msgstr "" -#: lib/Lufi/Controller/Files.pm:284 +#: lib/Lufi/Controller/Files.pm:283 msgid "Error: the file existed but was deleted." msgstr "" -#: lib/Lufi/Controller/Files.pm:364 +#: lib/Lufi/Controller/Files.pm:363 msgid "Error: the file has not been sent entirely." msgstr "" -#: lib/Lufi/Controller/Files.pm:374 +#: lib/Lufi/Controller/Files.pm:373 msgid "Error: unable to find the file. Are you sure of your URL?" msgstr "" @@ -250,7 +250,7 @@ msgstr "" msgid "Export localStorage data" msgstr "" -#: lib/Lufi/Controller/Files.pm:466 +#: lib/Lufi/Controller/Files.pm:465 msgid "File deleted" msgstr "" @@ -585,7 +585,7 @@ msgstr "" msgid "The expiration delay (%1) is not between 1 and %2 days." msgstr "" -#: lib/Lufi/Controller/Files.pm:463 +#: lib/Lufi/Controller/Files.pm:462 msgid "The file has already been deleted" msgstr "" @@ -640,11 +640,11 @@ msgstr "" msgid "The original (and only for now) author is Luc Didry." msgstr "" -#: lib/Lufi/Controller/Files.pm:231 +#: lib/Lufi/Controller/Files.pm:230 msgid "The server was unable to find the file record to add your file part to. Please, contact the administrator." msgstr "" -#: lib/Lufi/Controller/Files.pm:290 +#: lib/Lufi/Controller/Files.pm:289 msgid "This file has been deactivated by the admins. Contact them to know why." msgstr "" @@ -674,17 +674,17 @@ msgid "Unable to copy the link(s) to your clipboard" msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:434 +#: lib/Lufi/Controller/Files.pm:433 msgid "Unable to get counter for %1. The file does not exists. It will be removed from your localStorage." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:424 +#: lib/Lufi/Controller/Files.pm:423 msgid "Unable to get counter for %1. The token is invalid." msgstr "" #. ($short) -#: lib/Lufi/Controller/Files.pm:444 +#: lib/Lufi/Controller/Files.pm:443 msgid "Unable to get counter for %1. You are not authenticated." msgstr "" @@ -769,7 +769,7 @@ msgstr "" msgid "Your file is too big: %1 (maximum size allowed: %2)" msgstr "" -#: lib/Lufi/Controller/Files.pm:346 +#: lib/Lufi/Controller/Files.pm:345 msgid "Your password is not valid. Please refresh the page to retry." msgstr ""