Skip to content

Commit 2e5821c

Browse files
committed
add lock when write hosts to file
1 parent c4d4b47 commit 2e5821c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Qiniu/Zone.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private function hostCacheFromFile()
145145
private function hostCacheToFile()
146146
{
147147
$path = $this->hostCacheFilePath();
148-
file_put_contents($path, json_encode($this->hostCache));
148+
file_put_contents($path, json_encode($this->hostCache), LOCK_EX);
149149
return;
150150
}
151151

0 commit comments

Comments
 (0)