1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2025-02-01 12:31:38 +01:00

Fix installation after adding RestartQueueWorker::dispatch() to CleaCache

This commit is contained in:
FreeScout 2023-01-19 05:08:02 -08:00
parent c33b770b2e
commit 78b52bfb81
2 changed files with 15 additions and 2 deletions

View File

@ -54,6 +54,9 @@ class ClearCache extends Command
if (!$this->option('doNotGenerateVars')) {
$this->call('freescout:generate-vars');
}
\App\Jobs\RestartQueueWorker::dispatch()->onQueue('default');
// This should not be done during installation.
if (\Helper::isInstalled()) {
\App\Jobs\RestartQueueWorker::dispatch()->onQueue('default');
}
}
}

View File

@ -949,7 +949,12 @@ class Helper
// User may add an extra translation to the app on Translate page,
// we should allow user to see his custom translations.
$custom_locales = \Helper::getCustomLocales();
$custom_locales = [];
try {
$custom_locales = \Helper::getCustomLocales();
} catch (\Exception $e) {
// During installation it throws an error as there is no tables yet.
}
if (count($custom_locales)) {
$app_locales = array_unique(array_merge($app_locales, $custom_locales));
@ -1687,4 +1692,9 @@ class Helper
'ps (shell)' => function_exists('shell_exec') ? shell_exec('ps') : false,
];
}
public static function isInstalled()
{
return file_exists(storage_path().DIRECTORY_SEPARATOR.'.installed');
}
}