mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-14 17:25:01 +00:00
In case if cron isn't set, in Settings/Server tab you will see suggestions for cron command
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user