• Jared Ririe's avatar
    caddytls: Fix goroutine leak when restarting Caddy (#2644) · d11b6481
    Jared Ririe authored
    Each time the Caddyfile reloads and Caddy is restarted,
    caddytls.NewConfig starts a goroutine for cleaning the
    certificate storage. This goroutine ranges over a time.Ticker
    channel; although Stop is called on this ticker, Stop does
    not close the underlying channel so the goroutine never exits.
    
    This change adds an additional channel that is listened to
    in the certificate cleaning goroutine so it can exit
    on restarts.
    d11b6481
config.go 18.4 KB