mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
removed TODO. moved signal catches to handle()
Signed-off-by: jessicamack <jmack@redhat.com>
This commit is contained in:
@@ -59,17 +59,15 @@ class Command(BaseCommand):
|
|||||||
|
|
||||||
def do_hearbeat_loop(self):
|
def do_hearbeat_loop(self):
|
||||||
with pg_bus_conn(new_connection=True) as conn:
|
with pg_bus_conn(new_connection=True) as conn:
|
||||||
signal.signal(signal.SIGTERM, self.notify_listener_and_exit)
|
|
||||||
signal.signal(signal.SIGINT, self.notify_listener_and_exit)
|
|
||||||
while True:
|
while True:
|
||||||
logger.debug('Sending heartbeat')
|
logger.debug('Sending heartbeat')
|
||||||
conn.notify('web_heartbeet', self.construct_payload())
|
conn.notify('web_heartbeet', self.construct_payload())
|
||||||
time.sleep(settings.BROADCAST_WEBSOCKET_BEACON_FROM_WEB_RATE_SECONDS)
|
time.sleep(settings.BROADCAST_WEBSOCKET_BEACON_FROM_WEB_RATE_SECONDS)
|
||||||
|
|
||||||
# TODO: Send a message with action=offline if we notice a SIGTERM or SIGINT
|
|
||||||
# (wsrelay can use this to remove the node quicker)
|
|
||||||
def handle(self, *arg, **options):
|
def handle(self, *arg, **options):
|
||||||
self.print_banner()
|
self.print_banner()
|
||||||
|
signal.signal(signal.SIGTERM, self.notify_listener_and_exit)
|
||||||
|
signal.signal(signal.SIGINT, self.notify_listener_and_exit)
|
||||||
|
|
||||||
# Note: We don't really try any reconnect logic to pg_notify here,
|
# Note: We don't really try any reconnect logic to pg_notify here,
|
||||||
# just let supervisor restart if we fail.
|
# just let supervisor restart if we fail.
|
||||||
|
|||||||
Reference in New Issue
Block a user