tediousjs / tedious

Node TDS module for connecting to SQL Server databases.
http://tediousjs.github.io/tedious/
MIT License
1.58k stars 439 forks source link

refactor: cleanup rerouting and retry implementation #1660

Closed arthurschreiber closed 2 months ago

arthurschreiber commented 2 months ago

This cleans up the rerouting and retry implementations.

Instead of adding state specific logic to the overall close socket handler, we now just remove the close and end socket handlers and call socket.destroy before we perform rerouting or retry logic.

This moves the logic closer together and helps making it simpler to understand what's going on for both of these features.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.46%. Comparing base (e8c6228) to head (d6525ae). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1660 +/- ## ========================================== + Coverage 79.21% 85.46% +6.24% ========================================== Files 90 90 Lines 4855 4857 +2 Branches 929 924 -5 ========================================== + Hits 3846 4151 +305 + Misses 704 702 -2 + Partials 305 4 -301 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.