feat : check
This commit is contained in:
@@ -53,7 +53,7 @@ class PrinterCache
|
||||
private function __initPrinterListData(): void
|
||||
{
|
||||
$printerList = $this->printerModel->get();
|
||||
|
||||
var_dump($printerList->isEmpty());
|
||||
if ($printerList->isEmpty()) return;
|
||||
|
||||
$ylyPrinterList = [];
|
||||
@@ -67,8 +67,8 @@ class PrinterCache
|
||||
|
||||
$this->delCache();
|
||||
|
||||
$this->redisCache->set($this->ylyPrinterKey, json_encode($ylyPrinterList));
|
||||
$this->redisCache->set($this->jdPrinterKey, json_encode($jdPrinterList));
|
||||
$this->redisCache->set($this->ylyPrinterKey, json_encode($ylyPrinterList),RedisCode::SYSTEM_DB);
|
||||
$this->redisCache->set($this->jdPrinterKey, json_encode($jdPrinterList),RedisCode::SYSTEM_DB);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,7 @@ class PrinterCache
|
||||
*/
|
||||
public function getYlyPrinter(): array
|
||||
{
|
||||
if ($this->redisCache->exists($this->ylyPrinterKey,RedisCode::SYSTEM_DB)) $this->__initPrinterListData();
|
||||
if (!$this->redisCache->exists($this->ylyPrinterKey,RedisCode::SYSTEM_DB)) $this->__initPrinterListData();
|
||||
|
||||
$res = $this->redisCache->get($this->ylyPrinterKey, RedisCode::SYSTEM_DB);
|
||||
if (empty($res)) return [];
|
||||
@@ -92,7 +92,7 @@ class PrinterCache
|
||||
*/
|
||||
public function getOtherPrinter(): array
|
||||
{
|
||||
if ($this->redisCache->exists($this->jdPrinterKey,RedisCode::SYSTEM_DB)) $this->__initPrinterListData();
|
||||
if (!$this->redisCache->exists($this->jdPrinterKey,RedisCode::SYSTEM_DB)) $this->__initPrinterListData();
|
||||
|
||||
$res = $this->redisCache->get($this->jdPrinterKey, RedisCode::SYSTEM_DB);
|
||||
if (empty($res)) return [];
|
||||
@@ -106,7 +106,7 @@ class PrinterCache
|
||||
*/
|
||||
public function delCache(): void
|
||||
{
|
||||
$this->redisCache->delete($this->ylyPrinterKey);
|
||||
$this->redisCache->delete($this->jdPrinterKey);
|
||||
$this->redisCache->delete($this->ylyPrinterKey,RedisCode::SYSTEM_DB);
|
||||
$this->redisCache->delete($this->jdPrinterKey,RedisCode::SYSTEM_DB);
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class SiteCache
|
||||
$siteKey = CommonRedisKey::siteListKey();
|
||||
$LngLatKey = CommonRedisKey::siteLngLatKey();
|
||||
|
||||
if ($this->redis->exists($siteKey) && $this->redis->exists($LngLatKey)) return;
|
||||
if ($this->redis->exists($siteKey,RedisCode::SYSTEM_DB) && $this->redis->exists($LngLatKey,RedisCode::SYSTEM_DB)) return;
|
||||
|
||||
$siteList = $this->siteModel->getAllSiteList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user