Add interval sleep in reloader (#2595)
This commit is contained in:
parent
5369291c27
commit
65d7447cf6
@ -9,6 +9,7 @@ from multiprocessing.connection import Connection
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from signal import SIGINT, SIGTERM
|
from signal import SIGINT, SIGTERM
|
||||||
from signal import signal as signal_func
|
from signal import signal as signal_func
|
||||||
|
from time import sleep
|
||||||
from typing import Dict, Set
|
from typing import Dict, Set
|
||||||
|
|
||||||
from sanic.server.events import trigger_events
|
from sanic.server.events import trigger_events
|
||||||
@ -62,6 +63,7 @@ class Reloader:
|
|||||||
self.reload(",".join(changed) if changed else "unknown")
|
self.reload(",".join(changed) if changed else "unknown")
|
||||||
if after_trigger:
|
if after_trigger:
|
||||||
trigger_events(after_trigger, loop, app)
|
trigger_events(after_trigger, loop, app)
|
||||||
|
sleep(self.interval)
|
||||||
else:
|
else:
|
||||||
if reloader_stop:
|
if reloader_stop:
|
||||||
trigger_events(reloader_stop, loop, app)
|
trigger_events(reloader_stop, loop, app)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user