mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 11:15:58 +00:00
cron indicator improvement
This commit is contained in:
@@ -70,8 +70,8 @@ class Kernel extends ConsoleKernel
|
||||
->daily()
|
||||
->at('00:20');
|
||||
|
||||
// Store latest cron timestamp
|
||||
cache()->set('latest_cron_update', now()->toString());
|
||||
$schedule->call(fn () => cache()->set('latest_cron_update', now()->toString()))
|
||||
->everyMinute();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ class GetServerStatusController
|
||||
// Add cron info
|
||||
$status['cron'] = [
|
||||
'running' => isRunningCron(),
|
||||
'lastUpdate' => isRunningCron() ? format_date(cache()->get('latest_cron_update')) : '',
|
||||
'lastUpdate' => isRunningCron() ? format_date(cache()->get('latest_cron_update')) : null,
|
||||
];
|
||||
|
||||
return $status;
|
||||
|
||||
@@ -44,7 +44,7 @@ if (! function_exists('isRunningCron')) {
|
||||
*/
|
||||
function isRunningCron(): bool
|
||||
{
|
||||
return cache()->has('latest_cron_update') && Carbon::parse(cache()->get('latest_cron_update'))->diffInMinutes(now()) < 2;
|
||||
return cache()->has('latest_cron_update') && Carbon::parse(cache()->get('latest_cron_update'))->diffInMinutes(now()) <= 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user