In case if cron isn't set, in Settings/Server tab you will see suggestions for cron command

This commit is contained in:
Čarodej
2022-08-08 16:57:15 +02:00
parent 88fa5732d3
commit 60cdcff4ff
6 changed files with 38 additions and 5 deletions
@@ -41,10 +41,7 @@ class GetDashboardDataController extends Controller
'app' => [
'cron' => [
'isRunning' => isRunningCron(),
'command' => [
'shared' => PHP_BINARY . ' ' . base_path() . '/artisan schedule:run >> /dev/null 2>&1',
'vps' => '* * * * * cd ' . base_path() . ' && ' . PHP_BINARY . ' artisan schedule:run >> /dev/null 2>&1',
],
'command' => getCronCommandSuggestions(),
],
'license' => get_settings('license'),
'version' => config('vuefilemanager.version'),
@@ -31,6 +31,7 @@ class GetServerStatusController
$status['cron'] = [
'running' => isRunningCron(),
'lastUpdate' => isRunningCron() ? format_date(cache()->get('latest_cron_update')) : null,
'command' => getCronCommandSuggestions(),
];
return response()->json($status);
+13
View File
@@ -69,6 +69,19 @@ if (! function_exists('isRunningCron')) {
}
}
if (! function_exists('getCronCommandSuggestions')) {
/**
* it gets cron command suggestion for VPS and admin panels
*/
function getCronCommandSuggestions(): array
{
return [
'shared' => PHP_BINARY . ' ' . base_path() . '/artisan schedule:run >> /dev/null 2>&1',
'vps' => '* * * * * cd ' . base_path() . ' && ' . PHP_BINARY . ' artisan schedule:run >> /dev/null 2>&1',
];
}
}
if (! function_exists('getInnerFolderIds')) {
/**
* Get all folder children ids