Skip to content

Commit

Permalink
refactor: update functions in tsdb.utils.file with check_path;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jun 28, 2024
1 parent dba978e commit 7868c48
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tsdb/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def purge_path(path: str, ignore_errors: bool = True) -> None:
Errors are ignored if ignore_errors is set.
"""
# check the path
path = check_path(path)
assert os.path.exists(
path
), f"The given path {path} does not exists. Operation aborted."
Expand Down Expand Up @@ -216,7 +218,9 @@ def migrate_cache(target_path: str) -> None:
The new path for TSDB to store cached datasets.
"""
# check the target path
target_path = check_path(target_path)

cached_dataset_dir = determine_data_home()
migrate(cached_dataset_dir, target_path)
config_parser = read_configs()
Expand Down

0 comments on commit 7868c48

Please sign in to comment.