Stop retry after request closed #1268
elia-piacentini
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
I don't think that you can determinate that the request is closed/aborted by the client. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I am using
moleculer-web
with the retry middleware.A few days ago, I noticed that the retry mechanism continued even after the request had been closed or aborted. This suggests that resource-intensive operations, unable to respond within the connection timeout, continue to be retried until all the attempts are exhausted. This becomes particularly problematic when it comes to database operations, increasing the load on the database (and also impacting other operations on it).
I would expect that the retry mechanism stops itself after the request has been closed or has expired.
Maybe I could propose a pull request (if you are interested) but I need some hints: is there a way to determine if a request was closed by the client? Are there specific events or other indicators that I should be looking for?
Thanks for your work!
Beta Was this translation helpful? Give feedback.
All reactions