Skip to content

Commit cb5bdc8

Browse files
Merge pull request #796 from Mark-Simulacrum/prepare-fail
Add cache purge if we're out of disk space
2 parents 98133a1 + 3b79542 commit cb5bdc8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/runner/worker.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,20 @@ impl<'a> Worker<'a> {
195195
match detect_broken(rustwide_crate.fetch(self.workspace)) {
196196
Ok(()) => break,
197197
Err(e) => {
198-
if logs.to_string().contains("No space left on device") {
198+
if logs
199+
.to_string()
200+
.to_ascii_lowercase()
201+
.contains("no space left on device")
202+
{
203+
if attempt == 3 {
204+
// FIXME: Doesn't this cause us to potentially delete caches
205+
// used by other workers? Maybe we can do something more
206+
// intelligent here?
207+
if let Err(e) = self.workspace.purge_all_caches() {
208+
log::warn!("purging caches failed: {:?}", e);
209+
}
210+
}
211+
199212
if attempt == 15 {
200213
// If we've failed 15 times, then
201214
// just give up. It's been at least

0 commit comments

Comments
 (0)