改进 主机扣费判定
This commit is contained in:
parent
5adb06cd0a
commit
327006e337
@ -40,14 +40,15 @@ public function handle(): void
|
|||||||
if (app()->environment() != 'local') {
|
if (app()->environment() != 'local') {
|
||||||
$host = $host->where('minute_at', $this->minute);
|
$host = $host->where('minute_at', $this->minute);
|
||||||
}
|
}
|
||||||
|
$host->whereIn('status', ['running', 'stopped'])->with(['user', 'module'])->chunk(500, function ($hosts) {
|
||||||
$host->whereIn('status', ['running', 'stopped'])->with('user')->chunk(500, function ($hosts) {
|
$hosts->each(function ($host) {
|
||||||
foreach ($hosts as $host) {
|
if ($host->module->isUp()) {
|
||||||
dispatch(new self($this->minute, $host));
|
dispatch(new self($this->minute, $host));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
} else {
|
||||||
$this->host?->cost($this->host->getPrice());
|
$this->host->cost($this->host->getPrice());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user