(path: &Path, stats: &ModuleCacheStatistics)
| 755 | } |
| 756 | |
| 757 | fn write_stats_file(path: &Path, stats: &ModuleCacheStatistics) -> bool { |
| 758 | toml::to_string_pretty(&stats) |
| 759 | .map_err(|err| { |
| 760 | warn!( |
| 761 | "Failed to serialize stats file, path: {}, err: {}", |
| 762 | path.display(), |
| 763 | err |
| 764 | ) |
| 765 | }) |
| 766 | .and_then(|serialized| { |
| 767 | fs_write_atomic(path, "stats", serialized.as_bytes()).map_err(|_| ()) |
| 768 | }) |
| 769 | .is_ok() |
| 770 | } |
| 771 | |
| 772 | /// Tries to acquire a lock for specific task. |
| 773 | /// |
no test coverage detected