Last active
June 14, 2016 10:08
-
-
Save tkrajina/f208ab45dc1a9d7f94a964e241e74a4e to your computer and use it in GitHub Desktop.
A way to limit appengine SDK files watched (for changes)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 137005e7bc187141c5f6224aa6264079a2e95b95 Mon Sep 17 00:00:00 2001 | |
From: Tomo Krajina <[email protected]> | |
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