Skip to content

Instantly share code, notes, and snippets.

@saranrapjs
Created January 20, 2017 16:39
Show Gist options
  • Save saranrapjs/2219ff2db1105d46b179d3f697d6bd99 to your computer and use it in GitHub Desktop.
Save saranrapjs/2219ff2db1105d46b179d3f697d6bd99 to your computer and use it in GitHub Desktop.
This patch fixes the `goapp` local dev server to ignore GOPATH changes, the watching of which would otherwise yield the "There are too many files in your application for changes in all of them to be monitored" error.
--- mtime_file_watcher.py 2017-01-20 11:36:51.000000000 -0500
+++ mtime_file_watcher.py.new 2017-01-20 11:37:24.000000000 -0500
@@ -139,6 +139,9 @@
"""
filename_to_mtime = {}
num_files = 0
+ gopath = os.environ["GOPATH"]+os.sep+"src"
+ if self._directory == gopath:
+ return filename_to_mtime
for dirpath, dirnames, filenames in os.walk(self._directory,
followlinks=True):
if self._quit_event.is_set():
@saranrapjs
Copy link
Author

Something like this should work:

curl https://gist.githubusercontent.com/saranrapjs/2219ff2db1105d46b179d3f697d6bd99/raw/99bb4d018712e3d658c6d8c56415bac2ee2da5e2/mtime_file_watcher.py.patch | patch $(dirname $(which goapp))/google/appengine/tools/devappserver2/mtime_file_watcher.py -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment