/**
  * check if command has failed (returncode != 0) or locken and timeout exceeded
  *
  * @param ScheduledCommand $command
  *
  * @return bool
  */
 protected function checkCommandFailed(ScheduledCommand $command)
 {
     $executionTime = $command->getLastExecution();
     $executionTimestamp = $executionTime->getTimestamp();
     $timedOut = $executionTimestamp + $this->timeoutValue < $this->now;
     return $command->getLastReturnCode() != 0 || $command->getLocked() && ($this->timeoutValue === false || $timedOut);
 }