update
This commit is contained in:
@@ -4,6 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs\VirtualMachine\Rebuild;
|
||||
|
||||
use App\Http\Services\Telegram;
|
||||
use App\Jobs\Mail\Customer\VmRebuildFailedJob;
|
||||
use App\Models\ModuleVmware;
|
||||
use App\Services\VirtualMachine\Rebuild\VmRebuildAddonService;
|
||||
use App\Services\VirtualMachine\Rebuild\VmRebuildService;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -62,6 +65,8 @@ final class RebuildAddonInstallJob implements ShouldQueue
|
||||
'module_vmware_id' => $this->moduleVmwareId,
|
||||
'new_vm_id' => $this->newVmId,
|
||||
]);
|
||||
|
||||
(new Telegram)->SendRebuildStepNotification($ctx->vmName, $ctx->ip, 'Cài đặt addon (CPU/RAM/Disk)', true);
|
||||
}
|
||||
|
||||
public function failed(Throwable $e): void
|
||||
@@ -77,5 +82,22 @@ final class RebuildAddonInstallJob implements ShouldQueue
|
||||
'error_message' => 'AddonInstall failed: ' . $e->getMessage(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$vm = ModuleVmware::with('customer')->find($this->moduleVmwareId);
|
||||
(new Telegram)->SendRebuildStepNotification(
|
||||
$vm->name ?? "VM #{$this->moduleVmwareId}",
|
||||
$vm->ip ?? '',
|
||||
'Cài đặt addon (CPU/RAM/Disk)',
|
||||
false,
|
||||
$e->getMessage(),
|
||||
);
|
||||
|
||||
VmRebuildFailedJob::dispatch([
|
||||
'customer_email' => $vm?->customer?->email,
|
||||
'customer_name' => $vm?->customer?->fullname,
|
||||
'vm_name' => $vm->name ?? "VM #{$this->moduleVmwareId}",
|
||||
'ip' => $vm->ip ?? '',
|
||||
'module_vmware_id' => $this->moduleVmwareId,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user