Skip to content

Commit 7eb97bf

Browse files
iTroozsylvestre
authored andcommitted
make sccache -s always return current cache size
sccache server disk cache is usually initiated by the first compilation request. If `sccache -s` is issued before then, sccache will not return the currently occupied cache size This PR fixes that
1 parent cf0224f commit 7eb97bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cache/disk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Storage for DiskCache {
173173
}
174174

175175
async fn current_size(&self) -> Result<Option<u64>> {
176-
Ok(self.lru.lock().unwrap().get().map(|l| l.size()))
176+
Ok(Some(self.lru.lock().unwrap().get_or_init()?.size()))
177177
}
178178
async fn max_size(&self) -> Result<Option<u64>> {
179179
Ok(Some(self.lru.lock().unwrap().capacity()))

0 commit comments

Comments
 (0)