From 72e12e17c0b3d46e4c952d172bc51efb8568015d Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 22 Dec 2020 22:29:25 +0100 Subject: [PATCH] =?UTF-8?q?nombre=20d'essais=20en=20cas=20de=20fichier=20v?= =?UTF-8?q?errouill=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/class/jsondb/JsonDb.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/class/jsondb/JsonDb.class.php b/core/class/jsondb/JsonDb.class.php index 05566c29..1425f92f 100755 --- a/core/class/jsondb/JsonDb.class.php +++ b/core/class/jsondb/JsonDb.class.php @@ -120,13 +120,13 @@ class JsonDb extends \Prowebcraft\Dot */ public function save() { // 3 essais - for($i = 0; $i < 4; $i++) { + for($i = 0; $i <=3; $i++) { if(file_put_contents($this->db, json_encode($this->data, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT|LOCK_EX)) !== false) { break; } // Pause de 10 millisecondes usleep(10000); - if ($i === 4) { + if ($i === 3) { throw new \InvalidArgumentException('Erreur d\'écriture du fichier de données ' . $this->db); } }