Skip to content

Commit 59df0b9

Browse files
authored
fix: when the task has started and did not download the data, gc is failed (#915)
fix: if the task has started and did not download the data, gc is failed Signed-off-by: Gaius <[email protected]>
1 parent 41a1b34 commit 59df0b9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

dragonfly-client/src/gc/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,21 @@ impl GC {
182182
break;
183183
}
184184

185-
// If the task has no content length, skip it.
185+
// If the task has downloaded finished, task has the content length, evicted space is the
186+
// content length. If the task has started and did not download the data, and content
187+
// length is 0, evicted space is 0.
186188
let task_space = match task.content_length() {
187189
Some(content_length) => content_length,
188190
None => {
189-
error!("task {} has no content length", task.id);
190-
continue;
191+
// If the task has no content length, skip it.
192+
if !task.is_failed() {
193+
error!("task {} has no content length", task.id);
194+
continue;
195+
}
196+
197+
// If the task has started and did not download the data, and content length is 0.
198+
info!("task {} is failed, has no content length", task.id);
199+
0
191200
}
192201
};
193202

0 commit comments

Comments
 (0)