-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nats): Improve message handling.
- Removed the setTimeout line that was causing a fixed delay of 5 seconds. - Ensured consistent error handling by adding message.ack() in the try block after processing a message and moving it up from the processMessage function. - Introduced a processing variable to control the message processing loop. When the server shuts down, the processing variable is set to false, causing the loop to exit. - Updated the onClose hook to properly terminate the done function by setting processing to false, draining the subscription, and unsubscribing from the subscription. - Remove unnecessary console log. - Move handlers into dictionary. Closes #28
- Loading branch information
Mango Habanero
committed
Apr 28, 2023
1 parent
b9dad51
commit 554ffd9
Showing
2 changed files
with
34 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters