Merge pull request #240 from foomo/fix/service-enabler-watch-sleep

fix: check closed after sleep
This commit is contained in:
Kevin Franklin Kim 2025-06-03 08:08:38 +02:00 committed by GitHub
commit 0853bc437c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,10 +105,10 @@ func (w *ServiceEnabler) disable(ctx context.Context) error {
func (w *ServiceEnabler) watch(ctx context.Context) {
go func() {
for {
time.Sleep(time.Second)
if w.closed() {
break
}
time.Sleep(time.Second)
if value := w.enabledFn(); value != w.enabled() {
if value {
go func() {