Skip to content

Fix goroutine leak#5

Open
morse255 wants to merge 1 commit intoprogramic:mainfrom
umn-asr:fix_goroutine_leak
Open

Fix goroutine leak#5
morse255 wants to merge 1 commit intoprogramic:mainfrom
umn-asr:fix_goroutine_leak

Conversation

@morse255
Copy link

This PR modifies the Inform() function to take in a Context and exit when a signal comes in on the ctx.Done() channel. This fixes an issue where the goroutine is not cleaned up when a container restarts or is redeployed. Without this change, additional goroutines are spawned whenever a container restarts, and the previously spawned goroutine still remains active.

This PR modifies the `Inform()` function to take in a [Context](https://pkg.go.dev/context) and exit when a signal comes in on the `ctx.Done()` channel. This fixes an issue where the goroutine is not cleaned up when a container restarts or is redeployed. Without this change, additional goroutines are spawned whenever a container restarts, and the previously spawned goroutine still remains active.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant