From c60fc54b83f56f9b1f68b2fed0f748c4948ef439 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Sun, 27 Nov 2022 15:35:03 +0100 Subject: [PATCH] try to fix freeze on lock fail --- inc/class.activity.report.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/inc/class.activity.report.php b/inc/class.activity.report.php index 737cf74..3c6220b 100644 --- a/inc/class.activity.report.php +++ b/inc/class.activity.report.php @@ -562,7 +562,7 @@ class activityReport throw new Exception("Can't open file"); } // lock file - if (!flock($fp, LOCK_EX)) { + if (!flock($fp, LOCK_EX | LOCK_NB)) { throw new Exception("Can't lock file"); } if ($this->_global) { @@ -585,7 +585,7 @@ class activityReport if ($this->_global) { @fclose($this->lock_global); $this->lock_global = null; - } else { + } elseif ($this->lock_blog) { @fclose($this->lock_blog); $this->lock_blog = null; } @@ -666,7 +666,6 @@ class activityReport $this->unlockUpdate(); } catch (Exception $e) { $this->unlockUpdate(); - //throw $e; } return true; @@ -719,7 +718,6 @@ class activityReport } } } catch (Exception $e) { - //var_dump($e); $done = false; }