From 35ce11ecb9f81448a72b56ce4d5db105aa38ae0a Mon Sep 17 00:00:00 2001 From: catatsuy Date: Mon, 29 Feb 2016 00:37:54 +0900 Subject: [PATCH] =?UTF-8?q?cache=E3=81=8C=E6=9C=89=E5=8A=B9=E3=81=AA?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AE=E3=81=BF304=E3=82=92=E8=A6=8B?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- benchmarker/checker/action.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/benchmarker/checker/action.go b/benchmarker/checker/action.go index 87eb99793..e88982af9 100644 --- a/benchmarker/checker/action.go +++ b/benchmarker/checker/action.go @@ -120,8 +120,8 @@ func (a *Action) PlayWithImage(s *Session) error { req.Header.Add(key, val) } - urlCache, found := cache.GetInstance().Get(a.Path) - if found { + urlCache, cacheFound := cache.GetInstance().Get(a.Path) + if cacheFound { urlCache.Apply(req) } @@ -139,7 +139,8 @@ func (a *Action) PlayWithImage(s *Session) error { success := false - if res.StatusCode == http.StatusNotModified { + // キャッシュが有効でかつStatusNotModifiedのときは成功 + if cacheFound && res.StatusCode == http.StatusNotModified { success = true }