Skip to content

Commit

Permalink
修改pdoQuery方法获取缓存逻辑,和value方法保存一致,避免缓存清空情况导致报错
Browse files Browse the repository at this point in the history
  • Loading branch information
Hhh0121 committed Mar 28, 2024
1 parent e50fa80 commit 17e6700
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/db/PDOConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,8 @@ protected function pdoQuery(BaseQuery $query, $sql, bool $master = null): array
if (!$query->getOptions('force_cache')) {
$key = $cacheItem->getKey();

$data = $this->cache->get($key);

if (null !== $data) {
return $data;
if ($this->cache->has($key)) {
return $this->cache->get($key);
}
}
}
Expand Down

0 comments on commit 17e6700

Please sign in to comment.