This pull request refines the NewClient function to improve connection handling to the NATS server with better logging and enhanced connection lifecycle management.
Enhanced Connection Logic:
Removed the loop for connection attempts and replaced it with a single connection attempt.
Added ReconnectWait, MaxReconnects, and connection event handlers for better management.
Summary
This pull request refines the
NewClient
function to improve connection handling to the NATS server with better logging and enhanced connection lifecycle management.Enhanced Connection Logic:
Added
ReconnectWait
,MaxReconnects
, and connection event handlers for better management.https://github.com/forta-network/forta-node/issues/863