From d5a74f1829c1d82f57e1936add177a268de99116 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 28 Nov 2024 17:15:44 -0500 Subject: [PATCH] cache save --- www-api/app/Controllers/BaseController.php | 11 ++++++++--- www-api/app/Controllers/WrenchUserContacts.php | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/www-api/app/Controllers/BaseController.php b/www-api/app/Controllers/BaseController.php index 216d60b3..b35e0978 100644 --- a/www-api/app/Controllers/BaseController.php +++ b/www-api/app/Controllers/BaseController.php @@ -135,10 +135,15 @@ abstract class BaseController extends Controller public function deleteCache($cacheKey){ $data = []; $cacheKey = $this->cache_tag."-".$cacheKey; - if (cache($cacheKey)) { - // echo 'Getting Data From Cache!
'; - $data = unserialize(cache()->delete($cacheKey)); + try { + if (cache($cacheKey)) { + // echo 'Getting Data From Cache!
'; + $data = unserialize(cache()->delete($cacheKey)); + } + } catch (Exception $e) { + echo 'Caught exception: ', $e->getMessage(), "\n"; } + return $data; } private function data_stringify($data) { diff --git a/www-api/app/Controllers/WrenchUserContacts.php b/www-api/app/Controllers/WrenchUserContacts.php index 7ed410e6..b61947c1 100644 --- a/www-api/app/Controllers/WrenchUserContacts.php +++ b/www-api/app/Controllers/WrenchUserContacts.php @@ -40,7 +40,7 @@ class WrenchUserContacts extends BaseController $time_to_save = false; $endpoint = "CONTACTS_IMPORT_ACTION-". $member_uid; - $outC = $this->getCache($endpoint); // try find in cache + // $outC = $this->getCache($endpoint); // try find in cache if ( $in["mmode"] == 0 ){ $in["raw_contacts_0"] = $in["raw_contacts"]; // extra store raw $this->deleteCache($endpoint);