Skip to content
Permalink
Browse files

Fix logging SecondsLeft value (in case of a ping loop break)

  • Loading branch information...
alecpl committed Apr 16, 2019
1 parent fa972b1 commit 1e9534eca33684cabe6a317cf2ae7f641099bf51
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Syncroton/Command/Ping.php
@@ -137,6 +137,10 @@ public function handle()
// reconnect external connections, etc.
call_user_func($wakeupCallback);
// Calculate secondsLeft before any loop break just to have a correct value
// for logging purposes in case we breaked from the loop early
$secondsLeft = $intervalEnd - time();
try {
$device = $this->_deviceBackend->get($this->_device->id);
} catch (Syncroton_Exception_NotFound $e) {
@@ -249,7 +253,8 @@ public function handle()
if ($status != self::STATUS_NO_CHANGES_FOUND) {
break;
}
// Update secondsLeft (again)
$secondsLeft = $intervalEnd - time();
if ($this->_logger instanceof Zend_Log)

0 comments on commit 1e9534e

Please sign in to comment.
You can’t perform that action at this time.