Making several attempts when trying to read the includes map file
Publish PHP Package / docker (push) Successful in 5s Details

This commit is contained in:
Pavel Shevaev 2024-05-02 12:13:27 +03:00
parent fd876d28e2
commit cdf0d6dc78
1 changed files with 17 additions and 0 deletions

View File

@ -437,7 +437,24 @@ function config_get_includes_map_path() : string
function config_load_includes_map(?string $file = null) : array function config_load_includes_map(?string $file = null) : array
{ {
$file = $file ? $file : config_get_includes_map_path(); $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()); $includes_map = array(array(), array());
if(is_file($file)) if(is_file($file))