mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Validate directory before watching it with inotify
Fixes this exception that is raised when the inotify-based reloader is used in
combination with the `--chdir` option:
inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0)
This commit is contained in:
parent
27d1e9887a
commit
f39b065d4b
@ -104,7 +104,8 @@ if has_inotify:
|
||||
self._dirs = self.get_dirs()
|
||||
|
||||
for dirname in self._dirs:
|
||||
self._watcher.add_watch(dirname, mask=self.event_mask)
|
||||
if os.path.isdir(dirname):
|
||||
self._watcher.add_watch(dirname, mask=self.event_mask)
|
||||
|
||||
for event in self._watcher.event_gen():
|
||||
if event is None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user