Use setEx to add expiry to customer discount cache.

Previously, the customer discount cache lacked an expiry time, which could lead to stale data. This change ensures the cached value expires after 60 seconds, improving cache reliability.
This commit is contained in:
Jepp9350
2025-01-22 09:04:05 +01:00
parent 07627e6db7
commit 0ab9c1fd52
+1 -1
View File
@@ -151,7 +151,7 @@ class redis implements redis_i
public function cache_economic_customer_discount_percentage(int $customer_number, int $discount_percentage): self
{
// Cache the economic customer discount percentage
$this->set('economic_customer_discount_percentage_' . $customer_number, $discount_percentage);
$this->setEx('economic_customer_discount_percentage_' . $customer_number, $discount_percentage, 60);
return $this;
}