@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * $obj = $c->findPk(12, $con); |
| 149 | 149 | * </code> |
| 150 | 150 | * |
| 151 | - * @param mixed $key Primary key to use for the query |
|
| 151 | + * @param string $key Primary key to use for the query |
|
| 152 | 152 | * @param ConnectionInterface $con an optional connection object |
| 153 | 153 | * |
| 154 | 154 | * @return ChildInput|array|mixed the result, formatted by the current formatter |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | /** |
| 511 | 511 | * Filter the query by a related \Jalle19\StatusManager\Database\Instance object |
| 512 | 512 | * |
| 513 | - * @param \Jalle19\StatusManager\Database\Instance|ObjectCollection $instance The related object(s) to use as filter |
|
| 513 | + * @param Instance $instance The related object(s) to use as filter |
|
| 514 | 514 | * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
| 515 | 515 | * |
| 516 | 516 | * @throws \Propel\Runtime\Exception\PropelException |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * |
| 425 | 425 | * @see filterByUser() |
| 426 | 426 | * |
| 427 | - * @param mixed $userId The value to use as filter. |
|
| 427 | + * @param integer|null $userId The value to use as filter. |
|
| 428 | 428 | * Use scalar values for equality. |
| 429 | 429 | * Use array values for in_array() equivalent. |
| 430 | 430 | * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | * $query->filterBySubscriptionId(array('min' => 12)); // WHERE subscription_id > 12 |
| 509 | 509 | * </code> |
| 510 | 510 | * |
| 511 | - * @param mixed $subscriptionId The value to use as filter. |
|
| 511 | + * @param integer $subscriptionId The value to use as filter. |
|
| 512 | 512 | * Use scalar values for equality. |
| 513 | 513 | * Use array values for in_array() equivalent. |
| 514 | 514 | * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | * $query->filterByStarted(array('max' => 'yesterday')); // WHERE started > '2011-03-13' |
| 550 | 550 | * </code> |
| 551 | 551 | * |
| 552 | - * @param mixed $started The value to use as filter. |
|
| 552 | + * @param integer $started The value to use as filter. |
|
| 553 | 553 | * Values can be integers (unix timestamps), DateTime objects, or strings. |
| 554 | 554 | * Empty strings are treated as NULL. |
| 555 | 555 | * Use scalar values for equality. |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | /** |
| 687 | 687 | * Filter the query by a related \Jalle19\StatusManager\Database\Instance object |
| 688 | 688 | * |
| 689 | - * @param \Jalle19\StatusManager\Database\Instance|ObjectCollection $instance The related object(s) to use as filter |
|
| 689 | + * @param Instance $instance The related object(s) to use as filter |
|
| 690 | 690 | * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
| 691 | 691 | * |
| 692 | 692 | * @throws \Propel\Runtime\Exception\PropelException |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | /** |
| 764 | 764 | * Filter the query by a related \Jalle19\StatusManager\Database\Input object |
| 765 | 765 | * |
| 766 | - * @param \Jalle19\StatusManager\Database\Input|ObjectCollection $input The related object(s) to use as filter |
|
| 766 | + * @param Input $input The related object(s) to use as filter |
|
| 767 | 767 | * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
| 768 | 768 | * |
| 769 | 769 | * @throws \Propel\Runtime\Exception\PropelException |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | /** |
| 841 | 841 | * Filter the query by a related \Jalle19\StatusManager\Database\User object |
| 842 | 842 | * |
| 843 | - * @param \Jalle19\StatusManager\Database\User|ObjectCollection $user The related object(s) to use as filter |
|
| 843 | + * @param User $user The related object(s) to use as filter |
|
| 844 | 844 | * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
| 845 | 845 | * |
| 846 | 846 | * @throws \Propel\Runtime\Exception\PropelException |
@@ -917,7 +917,7 @@ discard block |
||
| 917 | 917 | /** |
| 918 | 918 | * Filter the query by a related \Jalle19\StatusManager\Database\Channel object |
| 919 | 919 | * |
| 920 | - * @param \Jalle19\StatusManager\Database\Channel|ObjectCollection $channel The related object(s) to use as filter |
|
| 920 | + * @param Channel $channel The related object(s) to use as filter |
|
| 921 | 921 | * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL |
| 922 | 922 | * |
| 923 | 923 | * @throws \Propel\Runtime\Exception\PropelException |
@@ -251,7 +251,7 @@ |
||
| 251 | 251 | |
| 252 | 252 | |
| 253 | 253 | /** |
| 254 | - * @param $instanceName |
|
| 254 | + * @param string $instanceName |
|
| 255 | 255 | * @param ConnectionStatus $connectionStatus |
| 256 | 256 | * |
| 257 | 257 | * @return bool whether the connection exists in the database |
@@ -70,8 +70,9 @@ discard block |
||
| 70 | 70 | $this->_instances = new \SplObjectStorage(); |
| 71 | 71 | |
| 72 | 72 | // Attach a state to each instance |
| 73 | - foreach ($this->_configuration->getInstances() as $instance) |
|
| 74 | - $this->_instances->attach($instance, new InstanceState()); |
|
| 73 | + foreach ($this->_configuration->getInstances() as $instance) { |
|
| 74 | + $this->_instances->attach($instance, new InstanceState()); |
|
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | // Start the persistence manager |
| 77 | 78 | $this->_persistenceManager = new PersistenceManager($logger); |
@@ -147,20 +148,24 @@ discard block |
||
| 147 | 148 | ]); |
| 148 | 149 | |
| 149 | 150 | // Persist connections |
| 150 | - foreach ($instanceStatus->getConnections() as $connection) |
|
| 151 | - $this->_persistenceManager->onConnectionSeen($instanceName, $connection); |
|
| 151 | + foreach ($instanceStatus->getConnections() as $connection) { |
|
| 152 | + $this->_persistenceManager->onConnectionSeen($instanceName, $connection); |
|
| 153 | + } |
|
| 152 | 154 | |
| 153 | 155 | // Persist inputs |
| 154 | - foreach($instanceStatus->getInputs() as $input) |
|
| 155 | - $this->_persistenceManager->onInputSeen($instanceName, $input); |
|
| 156 | + foreach($instanceStatus->getInputs() as $input) { |
|
| 157 | + $this->_persistenceManager->onInputSeen($instanceName, $input); |
|
| 158 | + } |
|
| 156 | 159 | |
| 157 | 160 | // Persist running subscriptions |
| 158 | - foreach ($instanceStatus->getSubscriptions() as $subscription) |
|
| 159 | - $this->_persistenceManager->onSubscriptionSeen($instanceName, $subscription); |
|
| 161 | + foreach ($instanceStatus->getSubscriptions() as $subscription) { |
|
| 162 | + $this->_persistenceManager->onSubscriptionSeen($instanceName, $subscription); |
|
| 163 | + } |
|
| 160 | 164 | |
| 161 | 165 | // Handle subscription state changes |
| 162 | - foreach ($instanceStatus->getSubscriptionStateChanges() as $subscriptionStateChange) |
|
| 163 | - $this->_persistenceManager->onSubscriptionStateChange($instanceName, $subscriptionStateChange); |
|
| 166 | + foreach ($instanceStatus->getSubscriptionStateChanges() as $subscriptionStateChange) { |
|
| 167 | + $this->_persistenceManager->onSubscriptionStateChange($instanceName, $subscriptionStateChange); |
|
| 168 | + } |
|
| 164 | 169 | } |
| 165 | 170 | |
| 166 | 171 | // Broadcast the status messages to all connected clients |
@@ -208,8 +213,7 @@ discard block |
||
| 208 | 213 | |
| 209 | 214 | $instanceState->setReachability(InstanceState::REACHABLE); |
| 210 | 215 | } |
| 211 | - } |
|
| 212 | - catch (\Exception $e) |
|
| 216 | + } catch (\Exception $e) |
|
| 213 | 217 | { |
| 214 | 218 | // Mark the instance as unreachable |
| 215 | 219 | $message = 'Instance {instanceName} not reachable, will wait for {cycles} cycles before retrying. |
@@ -223,8 +227,7 @@ discard block |
||
| 223 | 227 | |
| 224 | 228 | $instanceState->setReachability(InstanceState::UNREACHABLE); |
| 225 | 229 | } |
| 226 | - } |
|
| 227 | - else |
|
| 230 | + } else |
|
| 228 | 231 | { |
| 229 | 232 | // Wait for some cycles and then mark unreachable instances as maybe reachable |
| 230 | 233 | if ($instanceState->getRetryCount() === self::UNREACHABLE_CYCLES_UNTIL_RETRY - 1) |
@@ -235,9 +238,9 @@ discard block |
||
| 235 | 238 | $this->_logger->info('Retrying instance {instanceName} during next cycle', [ |
| 236 | 239 | 'instanceName' => $instanceName, |
| 237 | 240 | ]); |
| 241 | + } else { |
|
| 242 | + $instanceState->incrementRetryCount(); |
|
| 238 | 243 | } |
| 239 | - else |
|
| 240 | - $instanceState->incrementRetryCount(); |
|
| 241 | 244 | } |
| 242 | 245 | } |
| 243 | 246 | |