From 27758f45f17211ccfcb92bc37191051c1c42a029 Mon Sep 17 00:00:00 2001 From: Brendan Heywood Date: Sat, 7 Nov 2020 17:27:46 +1100 Subject: [PATCH] MDL-51111 cache: Don't lock and write the config file if unchanged --- cache/locallib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cache/locallib.php b/cache/locallib.php index db20b05fb2f..572e2f8e55c 100644 --- a/cache/locallib.php +++ b/cache/locallib.php @@ -68,6 +68,7 @@ class cache_config_writer extends cache_config { */ protected function config_save() { global $CFG; + static $confighash = ''; $cachefile = static::get_config_file_path(); $directory = dirname($cachefile); if ($directory !== $CFG->dataroot && !file_exists($directory)) { @@ -86,6 +87,15 @@ class cache_config_writer extends cache_config { // Prepare the file content. $content = "configlocks);