Skip to content

Commit

Permalink
fix: reconnect connection after publish action
Browse files Browse the repository at this point in the history
  • Loading branch information
dzvon authored Jan 7, 2020
1 parent 1fc78fa commit e44ba29
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/nsqphp.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ public function publish($topic, MessageInterface $msg)
}, $conn, 2);
} catch (\Exception $e) {
$errors[] = $e->getMessage();
} finally {
$conn->close();
}
if ($success >= $this->pubSuccessCount) {
break;
Expand All @@ -323,6 +321,7 @@ public function tryFunc(Callable $func, ConnectionInterface $conn, $tries = 1)
return;
} catch (\Exception $e) {
$lastException = $e;
} finally {
$conn->reconnect();
}
}
Expand Down

0 comments on commit e44ba29

Please sign in to comment.