Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB authored and taichi-gardener committed Dec 29, 2022
1 parent f4e3aa4 commit 72e0814
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 72e0814

Please sign in to comment.