diff --git a/config/services.yaml b/config/services.yaml index 180c5602..f8b30b8a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -247,7 +247,7 @@ services: App\Service\JobOrderJsonCache: arguments: $redis_prov: "@App\\Service\\RedisClientProvider" - $jo_json_info_key: "%env(JO_JSON_INFO_KEY)%" + $jo_json_cache_key: "%env(JO_JSON_CACHE_KEY)%" # inventory manager App\Service\InventoryManager: diff --git a/src/Service/JobOrderJsonCache.php b/src/Service/JobOrderJsonCache.php index 31e155d5..2df2fa5b 100644 --- a/src/Service/JobOrderJsonCache.php +++ b/src/Service/JobOrderJsonCache.php @@ -7,19 +7,19 @@ use App\Service\RedisClientProvider; class JobOrderJsonCache { protected $redis; - protected $jo_json_info_key; + protected $jo_json_cache_key; - public function __construct(RedisClientProvider $redis_prov, $jo_json_info_key) + public function __construct(RedisClientProvider $redis_prov, $jo_json_cache_key) { $this->redis = $redis_prov->getRedisClient(); - $this->jo_json_info_key = $jo_json_info_key; + $this->jo_json_cache_key = $jo_json_cache_key; } public function addJOJsonInfo($jo_id, $jo_data) { $key = $jo_id; - $this->redis->hset($this->jo_json_info_key, $key, $jo_data); + $this->redis->hset($this->jo_json_cache_key, $key, $jo_data); } public function findJOJsonInfo($jo_id) @@ -29,11 +29,11 @@ class JobOrderJsonCache $key = $jo_id; // check if JO id is in redis hash - $is_exist = $this->redis->hexists($this->jo_json_info_key, $key); + $is_exist = $this->redis->hexists($this->jo_json_cache_key, $key); if ($is_exist) { // get the data - $jo_data = $this->redis->hget($this->jo_json_info_key, $key); + $jo_data = $this->redis->hget($this->jo_json_cache_key, $key); } return $jo_data; @@ -44,10 +44,10 @@ class JobOrderJsonCache $key = $jo_id; // check if JO id is in redis hash - $is_exist = $this->redis->hexists($this->jo_json_info_key, $key); + $is_exist = $this->redis->hexists($this->jo_json_cache_key, $key); if ($is_exist) { - $this->redis->hdel($this->jo_json_info_key, $key); + $this->redis->hdel($this->jo_json_cache_key, $key); } } }