Skip to content

Commit bf21192

Browse files
committed
Merge branch 'feature/cache'
2 parents cf2f83a + 35ce11e commit bf21192

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

benchmarker/checker/action.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ func (a *Action) PlayWithImage(s *Session) error {
120120
req.Header.Add(key, val)
121121
}
122122

123-
urlCache, found := cache.GetInstance().Get(a.Path)
124-
if found {
123+
urlCache, cacheFound := cache.GetInstance().Get(a.Path)
124+
if cacheFound {
125125
urlCache.Apply(req)
126126
}
127127

@@ -139,7 +139,8 @@ func (a *Action) PlayWithImage(s *Session) error {
139139

140140
success := false
141141

142-
if res.StatusCode == http.StatusNotModified {
142+
// キャッシュが有効でかつStatusNotModifiedのときは成功
143+
if cacheFound && res.StatusCode == http.StatusNotModified {
143144
success = true
144145
}
145146

0 commit comments

Comments
 (0)