Protected Watchman autoreloader against busy loops.
With an error in the loop above (e.g. using query without args), this would trigger a busy loop. While this was caused due to changes to the loop itself, it seems to be just good practice to protect against this.
This commit is contained in:
parent
f06beea929
commit
ab943f031c
|
@ -546,6 +546,8 @@ class WatchmanReloader(BaseReloader):
|
||||||
for sub in list(self.client.subs.keys()):
|
for sub in list(self.client.subs.keys()):
|
||||||
self._check_subscription(sub)
|
self._check_subscription(sub)
|
||||||
yield
|
yield
|
||||||
|
# Protect against busy loops.
|
||||||
|
time.sleep(0.1)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.client.close()
|
self.client.close()
|
||||||
|
|
Loading…
Reference in New Issue