mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进缓存类的remember方法
This commit is contained in:
3
library/think/cache/Driver.php
vendored
3
library/think/cache/Driver.php
vendored
@@ -122,6 +122,7 @@ abstract class Driver
|
||||
if (!$this->has($name)) {
|
||||
while ($this->has($name . '_lock')) {
|
||||
// 存在锁定则等待
|
||||
usleep(100000);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -136,6 +137,8 @@ abstract class Driver
|
||||
} catch (\Exception $e) {
|
||||
// 解锁
|
||||
$this->rm($name . '_lock');
|
||||
} catch (\throwable $e) {
|
||||
$this->rm($name . '_lock');
|
||||
}
|
||||
} else {
|
||||
$value = $this->get($name);
|
||||
|
||||
Reference in New Issue
Block a user