From cdf0d6dc784c83d39ce2ddd54799db0120d54761 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 2 May 2024 12:13:27 +0300 Subject: [PATCH] Making several attempts when trying to read the includes map file --- config.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config.inc.php b/config.inc.php index 8196c77..bca5284 100644 --- a/config.inc.php +++ b/config.inc.php @@ -437,7 +437,24 @@ function config_get_includes_map_path() : string function config_load_includes_map(?string $file = null) : array { $file = $file ? $file : config_get_includes_map_path(); + //NOTE: workaround for Windows file locking issues + $attempts = 3; + while($attempts-- > 0) + { + try + { + return _config_load_includes_map($file); + } + catch(Exception) + {} + usleep(100); + echo "Reading includes file '$file' next attempt (left $attempts) ...\n"; + } + throw new Exception("Could not read includes file '$file'"); +} +function _config_load_includes_map(string $file = null) : array +{ $includes_map = array(array(), array()); if(is_file($file))