Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit 8a651e8

Browse files
committed
Only cache successful responses
1 parent 7c66474 commit 8a651e8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ impl Cache {
119119
output.extend_from_slice(b"\ntimeout triggered!");
120120
}
121121
let mut cache = self.cache.lock().unwrap();
122-
cache.insert(key, (status.clone(), output.clone()));
122+
if status.success() {
123+
cache.insert(key, (status.clone(), output.clone()));
124+
}
123125
Ok((status, output))
124126
}
125127
}

0 commit comments

Comments
 (0)