set process termination wait time to 100ms
This commit is contained in:
parent
c0aaea2d66
commit
e84acbd0f5
|
@ -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.
|
||||
|
|
|
@ -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...')
|
||||
|
|
Loading…
Reference in a new issue