diff --git a/src/think/cache/driver/File.php b/src/think/cache/driver/File.php index b36b069654..70a4757d79 100644 --- a/src/think/cache/driver/File.php +++ b/src/think/cache/driver/File.php @@ -176,7 +176,8 @@ public function set($name, $value, $expire = null): bool } $data = "\n" . $data; - $result = file_put_contents($filename, $data); + + $result = file_put_contents($filename, $data, LOCK_EX); if ($result) { clearstatcache();