diff --git a/nixos/modules/services/web-apps/kimai.nix b/nixos/modules/services/web-apps/kimai.nix index 47e1dfc20981..4ca464489b47 100644 --- a/nixos/modules/services/web-apps/kimai.nix +++ b/nixos/modules/services/web-apps/kimai.nix @@ -324,12 +324,14 @@ in ${pkg hostName cfg}/bin/console lint:yaml --parse-tags \ ${pkg hostName cfg}/share/php/kimai/config - # Run kimai:install to ensure database is created or updated. + # Before running any further console commands, clear cache. This + # avoids errors due to old cache getting used with new version + # of Kimai. + ${pkg hostName cfg}/bin/console cache:clear --env=prod + # Then, run kimai:install to ensure database is created or updated. # Note that kimai:update is an alias to kimai:install. ${pkg hostName cfg}/bin/console kimai:install --no-cache - # Clear cache and warmup cache separately, to avoid "Cannot declare - # class App\Entity\Timesheet" error on first init after upgrade. - ${pkg hostName cfg}/bin/console cache:clear --env=prod + # Finally, warm up cache. ${pkg hostName cfg}/bin/console cache:warmup --env=prod '';