Create clean shutdown logic for http worker

This commit is contained in:
Eli Ribble 2025-11-07 02:29:34 +00:00
parent a08cd87813
commit cf01c8c5c6
No known key found for this signature in database
4 changed files with 76 additions and 27 deletions

View file

@ -216,5 +216,14 @@ func redirectURL() string {
}
// This is a goroutine that is in charge of getting Fieldseeker data and keeping it fresh.
func refreshFieldseekerData(newOauthCh <-chan int, done <-chan struct{}) {
func refreshFieldseekerData(ctx context.Context, newOauthCh <-chan int) {
for {
select {
case <-ctx.Done():
slog.Info("Exiting refresh worker")
return
case id := <-newOauthCh:
slog.Info("Adding oauth to background work", slog.Int("oauth id", id))
}
}
}