Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkrajina/f208ab45dc1a9d7f94a964e241e74a4e to your computer and use it in GitHub Desktop.
Save tkrajina/f208ab45dc1a9d7f94a964e241e74a4e to your computer and use it in GitHub Desktop.
A way to limit appengine SDK files watched (for changes)
From 137005e7bc187141c5f6224aa6264079a2e95b95 Mon Sep 17 00:00:00 2001
From: Tomo Krajina <tkrajina@gmail.com>
Date: Tue, 14 Jun 2016 12:07:06 +0200
Subject: [PATCH] Limit the directory where watching for file changes
---
google/appengine/tools/devappserver2/mtime_file_watcher.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/google/appengine/tools/devappserver2/mtime_file_watcher.py b/google/appengine/tools/devappserver2/mtime_file_watcher.py
index 3d285d3..fa7d983 100644
--- a/google/appengine/tools/devappserver2/mtime_file_watcher.py
+++ b/google/appengine/tools/devappserver2/mtime_file_watcher.py
@@ -17,6 +17,7 @@
"""Monitors a directory tree for changes using mtime polling."""
import os
+import os.path
import threading
import warnings
@@ -117,8 +118,10 @@ class MtimeFileWatcher(object):
'restart the development server to see some changes to your '
'files.')
return filename_to_mtime
- num_files += 1
path = os.path.join(dirname, filename)
+ if not os.environ["APPENGINE_WATCH"] in path:
+ continue
+ num_files += 1
try:
filename_to_mtime[path] = os.path.getmtime(path)
except (IOError, OSError):
--
2.4.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment