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>
|
||||
Steven Cummings <estebistec@gmail.com>
|
||||
Sébastien Fievet <zyegfryed@gmail.com>
|
||||
Talha Malik <talham7391@hotmail.com>
|
||||
TedWantsMore <TedWantsMore@gmx.com>
|
||||
Thomas Grainger <tagrain@gmail.com>
|
||||
Thomas Steinacher <tom@eggdrop.ch>
|
||||
|
||||
@ -19,13 +19,11 @@ class Reloader(threading.Thread):
|
||||
super().__init__()
|
||||
self.setDaemon(True)
|
||||
self._extra_files = set(extra_files or ())
|
||||
self._extra_files_lock = threading.RLock()
|
||||
self._interval = interval
|
||||
self._callback = callback
|
||||
|
||||
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):
|
||||
fnames = [
|
||||
@ -34,8 +32,7 @@ class Reloader(threading.Thread):
|
||||
if getattr(module, '__file__', None)
|
||||
]
|
||||
|
||||
with self._extra_files_lock:
|
||||
fnames.extend(self._extra_files)
|
||||
fnames.extend(self._extra_files)
|
||||
|
||||
return fnames
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user