aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2024-07-27 18:53:44 -0500
committerAnthony Wang2024-07-27 18:53:44 -0500
commit59641e75d47e4186a2fec0e5d2c16116d2471090 (patch)
tree00f711751205d9a5bc2e4f7af40469ebd714c5e7
parente452bb52fc2f34a8b26c993cb5049f4db49661d3 (diff)
Skip nonexistent files when indexing
-rw-r--r--server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.py b/server.py
index 04a92e2..1e02a20 100644
--- a/server.py
+++ b/server.py
@@ -71,8 +71,8 @@ class EventHandler(FileSystemEventHandler):
def index(path, parent):
- if os.path.basename(path).startswith("."):
- # Skip hidden files
+ if not os.path.exists(path) or os.path.basename(path).startswith("."):
+ # Skip nonexistent or hidden files
return
print("Indexing", path, parent)