feat: add invalidation
This commit is contained in:
parent
4c018d0bf7
commit
42433a8cbf
@ -99,6 +99,8 @@ class SlotService
|
||||
$lockedHold->status = HoldStatus::Confirmed;
|
||||
$lockedHold->save();
|
||||
|
||||
$this->invalidateAvailabilityCache();
|
||||
|
||||
return $lockedHold->load('slot');
|
||||
});
|
||||
}
|
||||
@ -121,6 +123,8 @@ class SlotService
|
||||
$lockedHold->status = HoldStatus::Cancelled;
|
||||
$lockedHold->save();
|
||||
|
||||
$this->invalidateAvailabilityCache();
|
||||
|
||||
return $lockedHold->load('slot');
|
||||
});
|
||||
}
|
||||
@ -142,4 +146,9 @@ class SlotService
|
||||
->where('idempotency_key', $idempotencyKey)
|
||||
->first();
|
||||
}
|
||||
|
||||
private function invalidateAvailabilityCache(): void
|
||||
{
|
||||
Cache::forget(self::AVAILABILITY_CACHE_KEY);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user