File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ private function lazyReadRecords()
127127 private function readCachedRecords (bool $ useReadLock ): ?array
128128 {
129129 if (!is_file ($ this ->cacheFile )) {
130- if (false === file_put_contents ($ this ->cacheFile , '' )) {
130+ if (false === file_put_contents ($ this ->cacheFile , '' , LOCK_EX )) {
131131 throw new DbaException (sprintf ('Cache file "%s" is not readable and creating a new one did not succeed. ' , $ this ->cacheFile ));
132132 }
133133 }
@@ -202,7 +202,7 @@ public function persist(): void
202202 'runtimeConfig ' => QueryReflection::getRuntimeConfiguration ()->toArray (),
203203 ], true ).'; ' ;
204204
205- if (false === file_put_contents ($ this ->cacheFile , $ cacheContent )) {
205+ if (false === file_put_contents ($ this ->cacheFile , $ cacheContent, LOCK_EX )) {
206206 throw new DbaException (sprintf ('Unable to write cache file "%s" ' , $ this ->cacheFile ));
207207 }
208208
You can’t perform that action at this time.
0 commit comments