Skip to content

Commit

Permalink
Merge pull request #20 from kylin987/main
Browse files Browse the repository at this point in the history
bug修复
  • Loading branch information
chaz6chez authored Dec 8, 2023
2 parents 2d640d2 + db0d448 commit 6c0e328
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Process/InstanceRegistrarProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ protected function _heartbeat(string $name): void
$option['ephemeral'] = (is_string($option['ephemeral']) ? filter_var($option['ephemeral'], FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) : (bool) $option['ephemeral'] );
}
// 仅对非永久实例进行心跳
if (!($option['ephemeral'] ?? false)) {
if ($option['ephemeral'] ?? false) {
$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

0 comments on commit 6c0e328

Please sign in to comment.