middleware/metrics: fix crash (#295)

Fix the crash and add `setup_test.go` to catch this in the future.

Fixes #292
This commit is contained in:
Miek Gieben
2016-09-24 22:47:38 +01:00
committed by GitHub
parent 1ad02e8639
commit edc867fe56
2 changed files with 29 additions and 1 deletions

View File

@@ -79,6 +79,6 @@ func prometheusParse(c *caddy.Controller) (Metrics, error) {
return met, err
}
var metricsOnce *sync.Once
var metricsOnce sync.Once
const addr = "localhost:9153"