From 515927fd704cd5339064226b419401c85d906900 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 29 Jun 2022 10:34:49 +0700 Subject: [PATCH] handle empty tiles.yml --- tilefy/src/config_parser.py | 1 + tilefy/src/watcher.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tilefy/src/config_parser.py b/tilefy/src/config_parser.py index 54308bc..c420a8f 100644 --- a/tilefy/src/config_parser.py +++ b/tilefy/src/config_parser.py @@ -42,6 +42,7 @@ def load_yml(self): """load yml into redis""" if not self.exists: print("missing tiles.yml") + TilefyRedis().del_message("config") return self.get_conf() diff --git a/tilefy/src/watcher.py b/tilefy/src/watcher.py index d138aa5..b13f851 100644 --- a/tilefy/src/watcher.py +++ b/tilefy/src/watcher.py @@ -19,6 +19,9 @@ def __init__(self): def watch(self): """watch for changes, call from schedule""" + if not os.path.exists(self.FILE_PATH): + return + modified = self.is_changed() if modified: print(f"{self.FILE_PATH}: modified")