Skip to content

Instantly share code, notes, and snippets.

@loic
Created December 2, 2013 17:15
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 loic/7752939 to your computer and use it in GitHub Desktop.
Save loic/7752939 to your computer and use it in GitHub Desktop.
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py
index 3c71fa2..063b9f2 100644
--- a/django/utils/autoreload.py
+++ b/django/utils/autoreload.py
@@ -185,6 +185,7 @@ def kqueue_code_changed():
kqueue.control([make_kevent(watcher)], 0)
def update_watch(sender=None, **kwargs):
+ print("update_watch")
watcher.write(b'.')
request_finished.connect(update_watch)
@@ -194,6 +195,7 @@ def kqueue_code_changed():
filenames = set()
descriptors = set()
+ print("kqueue_code_changed")
while True:
old_filenames = filenames
filenames = set(gen_filenames())
@@ -231,6 +233,7 @@ def kqueue_code_changed():
kqueue.control([make_kevent(descriptor) for descriptor in new_descriptors], 0)
events = kqueue.control([], 1)
+ print("request_finished")
# After a request, reload the set of watched files.
if len(events) == 1 and events[0].ident == watcher.fileno():
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment