mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding file lock when use cache function. It will avoid errors when view cache is created by 2 threads concurrently.
This commit is contained in:
parent
3800029c9a
commit
a233460c7f
1 changed files with 1 additions and 1 deletions
|
@ -407,7 +407,7 @@ function cache($path, $data = null, $expires = '+1 day', $target = 'cache') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (is_writable(dirname($filename))) {
|
} elseif (is_writable(dirname($filename))) {
|
||||||
@file_put_contents($filename, $data);
|
@file_put_contents($filename, $data, LOCK_EX);
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue