update
This commit is contained in:
@@ -4,7 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Jobs\VirtualMachine\Rebuild;
|
||||
|
||||
use App\Http\Services\Telegram;
|
||||
use App\Jobs\Mail\Admin\AdminOrderNotificationJob;
|
||||
use App\Jobs\Mail\Customer\VmRebuildFailedJob;
|
||||
use App\Jobs\Mail\SendInformationVirtualMachine;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\ModuleVmware;
|
||||
@@ -94,6 +96,8 @@ final class RebuildFinalizeJob implements ShouldQueue
|
||||
'new_vm_id' => $this->newVmId,
|
||||
'old_vm_id' => $oldVmId,
|
||||
]);
|
||||
|
||||
(new Telegram)->SendRebuildStepNotification($ctx->vmName, $ctx->ip, 'Hoàn tất & chuyển đổi VM', true, 'Rebuild thành công, VM mới đã online.');
|
||||
}
|
||||
|
||||
public function failed(Throwable $e): void
|
||||
@@ -109,6 +113,23 @@ final class RebuildFinalizeJob implements ShouldQueue
|
||||
'error_message' => $e->getMessage(),
|
||||
'updated_at' => now(),
|
||||
]);
|
||||
|
||||
$vm = ModuleVmware::with('customer')->find($this->moduleVmwareId);
|
||||
(new Telegram)->SendRebuildStepNotification(
|
||||
$vm->name ?? "VM #{$this->moduleVmwareId}",
|
||||
$vm->ip ?? '',
|
||||
'Hoàn tất & chuyển đổi VM',
|
||||
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,
|
||||
]);
|
||||
}
|
||||
|
||||
private function sendCredentialsEmail(int $moduleVmwareId): void
|
||||
|
||||
Reference in New Issue
Block a user