diff options
author | Runxi Yu <me@runxiyu.org> | 2025-08-17 04:20:09 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-08-17 04:20:09 +0800 |
commit | 3f08901e844eda6c67b44e869c08ef9dc11265e4 (patch) | |
tree | 08dc84c18eb89df26845f9b2861a03391d1c5249 /forged/internal/incoming/hooks | |
parent | Fix potential goroutine leak from multi-serverpart errors (diff) | |
download | forge-3f08901e844eda6c67b44e869c08ef9dc11265e4.tar.gz forge-3f08901e844eda6c67b44e869c08ef9dc11265e4.tar.zst forge-3f08901e844eda6c67b44e869c08ef9dc11265e4.zip |
Fix a few other goroutine leaks with contexts
Diffstat (limited to 'forged/internal/incoming/hooks')
-rw-r--r-- | forged/internal/incoming/hooks/hooks.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/forged/internal/incoming/hooks/hooks.go b/forged/internal/incoming/hooks/hooks.go index c021406..3be0811 100644 --- a/forged/internal/incoming/hooks/hooks.go +++ b/forged/internal/incoming/hooks/hooks.go @@ -2,6 +2,7 @@ package hooks import ( "context" + "errors" "fmt" "net" @@ -59,7 +60,9 @@ func (server *Server) Run(ctx context.Context) error { for { conn, err := listener.Accept() if err != nil { - // TODO: Handle errors caused by context cancel + if errors.Is(err, net.ErrClosed) { + return nil + } return fmt.Errorf("accept conn: %w", err) } |