Permalink
Browse files

Reset cache between `goss serve` runs (#180)

  • Loading branch information...
aelsabbahy committed Dec 10, 2016
1 parent fc54b49 commit 9eaeeb235ffefcac798798284ce30ca99d283423
Showing with 2 additions and 0 deletions.
  1. +2 −0 serve.go
View
@@ -20,6 +20,7 @@ func Serve(c *cli.Context) {
cache := cache.New(c.Duration("cache"), 30*time.Second)
health := healthHandler{
+ c: c,
gossConfig: getGossConfig(c),
sys: system.New(c),
outputer: getOutputer(c),
@@ -64,6 +65,7 @@ func (h healthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if found {
resp = tmp.(res)
} else {
+ h.sys = system.New(h.c)
log.Printf("%v: Stale cache, running tests", r.RemoteAddr)
iStartTime := time.Now()
out := validate(h.sys, h.gossConfig, h.maxConcurrent)

0 comments on commit 9eaeeb2

Please sign in to comment.