Skip to content

Commit

Permalink
[Error] Do not show warning when the offline cache path does not exist (
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB authored and quadpixels committed May 13, 2023
1 parent 1a9acea commit 78a7973
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions taichi/cache/metal/cache_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ CacheManager::CacheManager(Params &&init_params)
if (config_.mode == MemAndDiskCache) {
const auto filepath = join_path(config_.cache_path, kMetadataFilename);
const auto lock_path = join_path(config_.cache_path, kMetadataLockName);
if (lock_with_file(lock_path)) {
auto _ = make_unlocker(lock_path);
offline_cache::load_metadata_with_checking(cached_data_, filepath);
} else {
TI_WARN(
"Lock {} failed. You can run 'ti cache clean -p {}' and try again.",
lock_path, config_.cache_path);
if (path_exists(filepath)) {
if (lock_with_file(lock_path)) {
auto _ = make_unlocker(lock_path);
offline_cache::load_metadata_with_checking(cached_data_, filepath);
} else {
TI_WARN(
"Lock {} failed. You can run 'ti cache clean -p {}' and try again.",
lock_path, config_.cache_path);
}
}
}
}
Expand Down

0 comments on commit 78a7973

Please sign in to comment.