Skip to content
Permalink
Browse files

Merge pull request #9 from alecpl/fix-secondsleft

Fix logging SecondsLeft value (in case of a ping loop break)
  • Loading branch information...
pschuele committed Apr 24, 2019
2 parents fa972b1 + 1e9534e commit 56a4fe8754dc3534b5e8187368e06ee0b6a37d2d
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 56a4fe8

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