From 26ea6a6c6996ec15ec8594262f7a0939bc498ec8 Mon Sep 17 00:00:00 2001 From: hide_d Date: Thu, 9 Dec 2021 00:36:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20KVStorage=EC=9D=98=20=EA=B8=B0=EB=B3=B8?= =?UTF-8?q?=20=EC=83=81=ED=83=9C=EA=B0=80=20turnOnCache=EA=B0=80=20?= =?UTF-8?q?=EC=95=84=EB=8B=88=EC=97=88=EB=8D=98=20=EC=A0=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sammo/KVStorage.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sammo/KVStorage.php b/src/sammo/KVStorage.php index b6db4eff..2e52073e 100644 --- a/src/sammo/KVStorage.php +++ b/src/sammo/KVStorage.php @@ -26,6 +26,7 @@ class KVStorage{ $this->db = $db; $this->storNamespace = $storNamespace; $this->tableName = $tableName; + $this->turnOnCache(); } public static function getValuesFromInterNamespace(\MeekroDB $db, string $tableName, $key):array{ @@ -58,6 +59,13 @@ class KVStorage{ return $this; } + public function turnOffCache(): self{ + if($this->cacheData !== null){ + $this->cacheData = null; + } + return $this; + } + public function resetCache(bool $disableCache=true):self{ if($disableCache){ $this->cacheData = null;