Skip to content

Commit

Permalink
Merge pull request #13 from Tinywan/patch-3
Browse files Browse the repository at this point in the history
fix: \InstanceProvider::beat() must be of the type bool or null, string given
  • Loading branch information
chaz6chez authored Oct 25, 2023
2 parents 36bba26 + 80cdaa3 commit 767617a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Process/InstanceRegistrarProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ protected function _heartbeat(string $name): void
if(isset($this->instanceRegistrars[$name])){
$this->heartbeatTimers[$name] = Timer::add($this->heartbeat, function () use ($name) {
list($serviceName, $ip, $port, $option) = $this->instanceRegistrars[$name];
if (isset($option['ephemeral'])) {
$option['ephemeral'] = (is_string($option['ephemeral']) ? filter_var($option['ephemeral'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) : (bool) $option['ephemeral'] );
}
try {
if(!$this->client->instance->beat(
$serviceName,
Expand Down Expand Up @@ -171,4 +174,4 @@ public function onWorkerStop(Worker $worker)
);
}
}
}
}

0 comments on commit 767617a

Please sign in to comment.