big update all menus
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace App\Jobs;
|
||||
use App\Models\CustomerNasAccount;
|
||||
use App\Services\Nas\CustomerAccountReconciliationService;
|
||||
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Queue\Queueable;
|
||||
use Throwable;
|
||||
class ReconcileCustomerNasAccount implements ShouldQueue, ShouldBeUnique
|
||||
{
|
||||
use Queueable; public int $tries=1; public int $timeout=30; public int $uniqueFor=240;
|
||||
public function __construct(public int $accountId){$this->onQueue('nas-reconciliation');}
|
||||
public function uniqueId(): string{return (string)$this->accountId;}
|
||||
public function handle(CustomerAccountReconciliationService $service): void { $a=CustomerNasAccount::find($this->accountId); if(!$a)return; try{$service->reconcile($a);}catch(Throwable $e){$a->update(['last_reconciled_at'=>now(),'last_sync_error'=>$e->getMessage()]);} }
|
||||
}
|
||||
Reference in New Issue
Block a user