mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 17:56:34 +08:00
59bf71c293
* Add a shutdown function and context to staticUpstream so that running goroutines can be cancelled. Add a GetShutdownFunc to Upstream interface to expose the shutdown function to the caddy Controller for performing it on restarts. * Make fakeUpstream implement new Upstream methods. Implement new Upstream method for fakeWSUpstream as well. * Rename GetShutdownFunc to Stop(). Add a waitgroup to the staticUpstream for controlling individual object's goroutines. Add the Stop function to OnRestart and OnShutdown. Add tests for checking to see if healthchecks continue hitting a backend server after stop has been called. * Go back to using a stop channel since the context adds no additional benefit. Only register stop function for onShutdown since it's called as part of restart. * Remove assignment to atomic value * Incrementing WaitGroup outside of goroutine to avoid race condition. Loading atomic values in test. * Linting: change counter to just use the default zero value instead of setting it * Clarify Stop method comments, add comments to stop channel and waitgroup and remove out of date comment about handling stopping the proxy. Stop the ticker when the stop signal is sent |
||
---|---|---|
.. | ||
basicauth | ||
bind | ||
browse | ||
errors | ||
expvar | ||
extensions | ||
fastcgi | ||
gzip | ||
header | ||
httpserver | ||
internalsrv | ||
log | ||
markdown | ||
maxrequestbody | ||
mime | ||
pprof | ||
proxy | ||
push | ||
redirect | ||
rewrite | ||
root | ||
staticfiles | ||
status | ||
templates | ||
timeouts | ||
websocket | ||
caddyhttp_test.go | ||
caddyhttp.go |