set process termination wait time to 100ms

This commit is contained in:
Izalia Mae 2021-10-15 11:50:32 -04:00
parent c0aaea2d66
commit e84acbd0f5
2 changed files with 4 additions and 4 deletions

View file

@ -20,4 +20,4 @@ Note: When installing from source in a virtualenv created via pyenv, do `pip ins
## Usage
Run `reload` in the base directory you want to watch to generate a `reload.cfg` file. Edit it to suite your needs and then run `reload` again.
Run `reload` in the base directory you want to watch to generate a `reload.json` file. Edit it to suite your needs and then run `reload` again.

View file

@ -28,11 +28,11 @@ class WatchHandler(PatternMatchingEventHandler):
logging.info(f'Terminating process {self.proc.pid}')
self.proc.terminate()
sec = 0
sec = 0.0
while self.proc.poll() == None:
time.sleep(1)
sec += 1
time.sleep(0.1)
sec += 0.1
if sec >= 5:
logging.error('Failed to terminate. Killing process...')