update logic
This commit is contained in:
@@ -40,21 +40,20 @@ class SyncNetwork implements ShouldQueue
|
||||
{
|
||||
|
||||
foreach ($this->data as $item) {
|
||||
$this->vCenter->apiUri = $item->host;
|
||||
|
||||
if (!$item->token) {
|
||||
$token = $this->vCenter->loginServer($item);
|
||||
if ($token) {
|
||||
vCenter::where('id', $item->id)->update(['token' => $token]);
|
||||
$this->vCenter->token = $token;
|
||||
$item->token = $token;
|
||||
}
|
||||
}
|
||||
$this->vCenter->token = $item->token;
|
||||
|
||||
if (! $this->vCenter->token) {
|
||||
if (! $item->token) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->vCenter->setConnection($item->host, $item->token);
|
||||
|
||||
$dataCenter = ModuleDatacenter::where('vcenter_id', $item->id)->select('id', 'datacenter_id')->get();
|
||||
foreach ($dataCenter as $_item) {
|
||||
$allHost = ModuleHost::where('module_datacenter_id', $_item->id)
|
||||
|
||||
Reference in New Issue
Block a user