moov-io / achgateway

Payment gateway enabling automated ACH operations in a distributed and fault tolerant way.
https://moov-io.github.io/achgateway/
Apache License 2.0
54 stars 19 forks source link

fix: stop accumulating receivers on each handled message #105

Closed adamdecaf closed 2 years ago

adamdecaf commented 2 years ago

I noticed we were emitting "nil message received" on shutdown the exactly the same amount as messages received. This led me down an investigation where it appeared we were keeping goroutines around.

Now we shutdown those goroutines once they're not needed to avoid extra resources being wasted.

Fixes: https://github.com/moov-io/achgateway/issues/102

codecov-commenter commented 2 years ago

Codecov Report

Merging #105 (d37d621) into master (0f22f57) will increase coverage by 0.16%. The diff coverage is 85.71%.

@@            Coverage Diff             @@
##           master     #105      +/-   ##
==========================================
+ Coverage   42.00%   42.17%   +0.16%     
==========================================
  Files          86       86              
  Lines        3573     3576       +3     
==========================================
+ Hits         1501     1508       +7     
+ Misses       1790     1787       -3     
+ Partials      282      281       -1     
Impacted Files Coverage Δ
internal/pipeline/file_receiver.go 39.28% <85.71%> (+3.50%) :arrow_up:
internal/upload/sftp.go 66.06% <0.00%> (+0.90%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f22f57...d37d621. Read the comment docs.