This commit is contained in:
baodev0
2026-07-21 08:34:15 +07:00
parent 3f477a559d
commit c3b5417b19
19 changed files with 652 additions and 20 deletions
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Jobs\VirtualMachine\Rebuild;
use App\Http\Services\Telegram;
use App\Http\Services\vCenter as VCenterService;
use App\Models\ModuleVmware;
use App\Models\vCenter as VCenterModel;
@@ -82,6 +83,8 @@ final class RebuildDeleteOldVmJob implements ShouldQueue
'old_vm_id' => $this->oldVmId,
'result' => $res,
]);
(new Telegram)->SendRebuildStepNotification($vm->name ?? '', $vm->ip ?? '', 'Xoá VM cũ', true);
} catch (Throwable $e) {
Log::error('RebuildDeleteOldVmJob: delete failed', [
'old_vm_id' => $this->oldVmId,
@@ -99,5 +102,14 @@ final class RebuildDeleteOldVmJob implements ShouldQueue
'old_vm_id' => $this->oldVmId,
'error' => $e->getMessage(),
]);
$vm = ModuleVmware::find($this->moduleVmwareId);
(new Telegram)->SendRebuildStepNotification(
$vm->name ?? "VM #{$this->moduleVmwareId}",
$vm->ip ?? '',
'Xoá VM cũ',
false,
"Old VM {$this->oldVmId} cần xoá thủ công: " . $e->getMessage(),
);
}
}