重新调整时间

This commit is contained in:
iVampireSP.com 2022-11-08 17:48:59 +08:00
parent c27ed95ace
commit 2a76cd5486
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
2 changed files with 4 additions and 2 deletions

View File

@ -35,7 +35,7 @@ protected function schedule(Schedule $schedule)
$schedule->job(new DeleteHost())->hourly();
$schedule->job(new CheckHostIfExistsOnModule())->hourly()->withoutOverlapping()->onOneServer();
$schedule->job(new CheckHostIfExistsOnModule())->everyThirtyMinutes()->withoutOverlapping()->onOneServer();
$schedule->job(new CheckAndChargeBalance())->everyFiveMinutes()->onOneServer()->withoutOverlapping();
}

View File

@ -32,8 +32,10 @@ public function __construct()
*/
public function handle()
{
// now 添加1.5小时
//
Host::with('module')->chunk(100, function ($hosts) {
Host::with('module')->where('created_at', '<', now()->subHour())->chunk(100, function ($hosts) {
foreach ($hosts as $host) {
$http = Http::remote($host->module->api_token, $host->module->url);
$response = $http->get('hosts/' . $host->id);