Skip to content

Commit

Permalink
Be sure that the config file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 19, 2024
1 parent 99f6f25 commit a8759a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tilecloud_chain/multitilestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def __init__(self, get_store: Callable[[str, str], TileStore | None]) -> None:
self.stores: dict[tuple[str, str], _DatedStore | None] = {}

def _get_store(self, config_file: str, layer: str) -> TileStore | None:
mtime = Path(config_file).stat().st_mtime
config_path = Path(config_file)
if not config_path.exists():
logger.warning("Config file %s does not exist", config_file)
return None
mtime = config_path.stat().st_mtime
store = self.stores.get((config_file, layer))
if store is not None and store.mtime != mtime:
store = None
Expand Down

0 comments on commit a8759a3

Please sign in to comment.