mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Remove locking in polling reloader
This commit is contained in:
parent
a4b6b1385a
commit
51a4afd7ef
1
THANKS
1
THANKS
@ -163,6 +163,7 @@ Stephen DiCato <Locker537@gmail.com>
|
|||||||
Stephen Holsapple <sholsapp@gmail.com>
|
Stephen Holsapple <sholsapp@gmail.com>
|
||||||
Steven Cummings <estebistec@gmail.com>
|
Steven Cummings <estebistec@gmail.com>
|
||||||
Sébastien Fievet <zyegfryed@gmail.com>
|
Sébastien Fievet <zyegfryed@gmail.com>
|
||||||
|
Talha Malik <talham7391@hotmail.com>
|
||||||
TedWantsMore <TedWantsMore@gmx.com>
|
TedWantsMore <TedWantsMore@gmx.com>
|
||||||
Thomas Grainger <tagrain@gmail.com>
|
Thomas Grainger <tagrain@gmail.com>
|
||||||
Thomas Steinacher <tom@eggdrop.ch>
|
Thomas Steinacher <tom@eggdrop.ch>
|
||||||
|
|||||||
@ -19,12 +19,10 @@ class Reloader(threading.Thread):
|
|||||||
super().__init__()
|
super().__init__()
|
||||||
self.setDaemon(True)
|
self.setDaemon(True)
|
||||||
self._extra_files = set(extra_files or ())
|
self._extra_files = set(extra_files or ())
|
||||||
self._extra_files_lock = threading.RLock()
|
|
||||||
self._interval = interval
|
self._interval = interval
|
||||||
self._callback = callback
|
self._callback = callback
|
||||||
|
|
||||||
def add_extra_file(self, filename):
|
def add_extra_file(self, filename):
|
||||||
with self._extra_files_lock:
|
|
||||||
self._extra_files.add(filename)
|
self._extra_files.add(filename)
|
||||||
|
|
||||||
def get_files(self):
|
def get_files(self):
|
||||||
@ -34,7 +32,6 @@ class Reloader(threading.Thread):
|
|||||||
if getattr(module, '__file__', None)
|
if getattr(module, '__file__', None)
|
||||||
]
|
]
|
||||||
|
|
||||||
with self._extra_files_lock:
|
|
||||||
fnames.extend(self._extra_files)
|
fnames.extend(self._extra_files)
|
||||||
|
|
||||||
return fnames
|
return fnames
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user