--
Ticket URL: <https://code.djangoproject.com/ticket/28602>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> Currently utils/autoreload.py has implementation for inotify based file
> system watcher. On Windows it scans all files for changes every 1 second
> which takes a lot of CPU. Windows provides file system watching API
> (FindFirstChangeNotification) which does the same thing as inotify on
> Linux. Django should take advantage of the API to make autoreloader more
> efficient.
New description:
Currently utils/autoreload.py has implementation for inotify based file
system watcher. On Windows it scans all files for changes every 1 second
which takes a lot of CPU. Windows provides file system watching API
(FindFirstChangeNotification) which does the same thing as inotify on
Linux. Django should take advantage of the API to make autoreload more
efficient.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:1>
* has_patch: 0 => 1
* type: Uncategorized => New feature
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/9093 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:2>
Comment (by Tom):
This is similar to: https://code.djangoproject.com/ticket/27685
I've got a PR in that ticket (https://github.com/django/django/pull/8819)
to refactor the autoreloader and add support for the Watchdog library (and
watchman) over pyinotify, which handles the intricacies of Windows, Linux
and Mac file system notifications. IMO, after reading the Watchdog code
and seeing the rather tricky corner cases it handles (e.g
[[https://github.com/gorakhargosh/watchdog/blob/f1d32fd0e02cfbc727ae2b15f6eb9937959c3541/src/watchdog/observers/read_directory_changes.py#L85-L104|this]])
it would be best to outsource it there than maintain our own.
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:3>
* cc: Tom (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:4>
* cc: Tzu-ping Chung (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:5>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:6>
Comment (by Tom Forbes):
I would consider closing this now
https://code.djangoproject.com/ticket/27685 is fixed, Watchman has beta
support for Windows platforms. Hopefully that will mature in the future,
so it seems redundant to duplicate work on a windows-specific reloader
implementation.
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:7>
* status: new => closed
* resolution: => wontfix
Comment:
I'm not a Windows user but that sounds reasonable to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/28602#comment:8>