From 9764cf3f65fd1708cf242d886ed78342cbc82f07 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 23 Nov 2015 11:00:28 +0200 Subject: [PATCH] Sync CompiledFile class with Gantry --- system/src/Grav/Common/File/CompiledFile.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/src/Grav/Common/File/CompiledFile.php b/system/src/Grav/Common/File/CompiledFile.php index 7120c9c30..6b6b76989 100644 --- a/system/src/Grav/Common/File/CompiledFile.php +++ b/system/src/Grav/Common/File/CompiledFile.php @@ -47,7 +47,11 @@ trait CompiledFile || $cache['filename'] != $this->filename ) { // Attempt to lock the file for writing. - $file->lock(false); + try { + $file->lock(false); + } catch (\Exception $e) { + // Another process has locked the file; we will check this in a bit. + } // Decode RAW file into compiled array. $data = (array) $this->decode($this->raw()); @@ -64,6 +68,7 @@ trait CompiledFile $file->unlock(); } } + $file->free(); $this->content = $cache['data']; }