coupergateway / couper

Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects
https://couper.io
MIT License
85 stars 15 forks source link

watch with double go routines #730

Closed alex-schneider closed 1 year ago

alex-schneider commented 1 year ago

closes #692


Reviewer checklist
  • Read PR description: a summary about the changes is required
  • Changelog updated
  • Documentation: docs/{Reference, Cli, ...}, Docker and cli help/usage
  • Pulled branch, manually tested
  • Verified requirements are met
  • Reviewed the code
  • Reviewed the related tests
johakoch commented 1 year ago

handler/transport/probe.go:

    // do not start go-routine on config check (-watch)
    if _, exist := opts.Context.Value(request.ConfigDryRun).(bool); exist {
        return
    }

    if _, exist := tc.Context.Value(request.ConfigDryRun).(bool); !exist {
        go p.probe(opts.Context)
    }

Looks like the first part already tries to solve the problem. Why does it not work?