Skip to content

Commit

Permalink
Update pingtracking.php
Browse files Browse the repository at this point in the history
Removed DEBUG statements and associated branches.
Added comment
  • Loading branch information
liverpoolfc-fan committed Apr 29, 2024
1 parent 11f53c6 commit c945550
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/lib/core/pingtracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,13 @@ public function DoForcePingTimeout() {
if (is_array($pings) && isset($pings[self::$devid][self::$user]) && count($pings[self::$devid][self::$user]) > 1) {
foreach ($pings[self::$devid][self::$user] as $pid=>$starttime)
if ($starttime > self::$start) {
ZLog::Write(LOGLEVEL_DEBUG, "MultiPINGS: " . "Other process starttime after mine so terminate me - return TRUE");
return true;
}
elseif ($starttime == self::$start) {
// Arbitrary decision to differentiate multiple processes that started at the same second for the same user. Compare PIDs
// If the other process has a bigger PID then kill this process
if ($pid > self::$pid) {
ZLog::Write(LOGLEVEL_DEBUG, "MultiPINGS: " . 'Other process [' . $pid .'] starttime same as mine : Other process ID is "bigger" than mine - return TRUE');
return true;
} elseif ($pid < self::$pid) {
ZLog::Write(LOGLEVEL_DEBUG, "MultiPINGS: " . 'Other process [' . $pid .'] starttime same as mine : Other process ID is "smaller" than mine - return FALSE');
}
else {
ZLog::Write(LOGLEVEL_DEBUG, "MultiPINGS: " . 'This is my PID - Ignore me - return FALSE');
}
}
}
Expand Down

0 comments on commit c945550

Please sign in to comment.