From 7a2b11237e3988ba61b5d0ba19125b0d279b3620 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 11 Jul 2023 23:04:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=96=87=E4=BB=B6=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=94=81=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/think/cache/driver/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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();