mw/proxy: simplify google code (#1019)

* mw/proxy: simplify google code

Minimize bootstrap code a bit, and block on the first resolve of the
google https endpont. Add more logging and include actual error in the
returned errors.

Also re-resolve every 120 seconds, instead of 300 (might eventually make
this an option).

* fix test
This commit is contained in:
Miek Gieben 2017-09-02 18:43:52 +02:00 committed by GitHub
parent 3a96d1ab77
commit 9bcddc5c16
5 changed files with 48 additions and 43 deletions

View file

@ -30,7 +30,8 @@ func setup(c *caddy.Controller) error {
c.OnStartup(OnStartupMetrics)
for _, u := range upstreams {
for i := range upstreams {
u := upstreams[i]
c.OnStartup(func() error {
return u.Exchanger().OnStartup(P)
})