Replace calls to gevent.signal() with gevent.signal_handler()

gevent.signal() was removed in gevent 1.5a4, see http://www.gevent.org/api/gevent.signal.html
Removed on Feb 5th, see https://github.com/gevent/gevent/pull/1530
pull/184/head
HubbeKing 4 years ago committed by Christopher Usher
parent a53786dc2d
commit 86f7823348

@ -573,7 +573,7 @@ def main(channels, base_dir='.', qualities='source', metrics_port=8002,
def stop(): def stop():
manager.stop() manager.stop()
gevent.signal(signal.SIGTERM, stop) gevent.signal_handler(signal.SIGTERM, stop)
if backdoor_port: if backdoor_port:
gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start()

@ -603,7 +603,7 @@ def main(
tags = tags.split(',') if tags else [] tags = tags.split(',') if tags else []
stop = gevent.event.Event() stop = gevent.event.Event()
gevent.signal(signal.SIGTERM, stop.set) # shut down on sigterm gevent.signal_handler(signal.SIGTERM, stop.set) # shut down on sigterm
logging.info("Starting up") logging.info("Starting up")

@ -604,7 +604,7 @@ def main(channels, base_dir=".", qualities="source", metrics_port=8001, backdoor
for manager in managers: for manager in managers:
manager.stop() manager.stop()
gevent.signal(signal.SIGTERM, stop) # shut down on sigterm gevent.signal_handler(signal.SIGTERM, stop) # shut down on sigterm
common.PromLogCountsHandler.install() common.PromLogCountsHandler.install()
common.install_stacksampler() common.install_stacksampler()

@ -332,7 +332,7 @@ def main(host='0.0.0.0', port=8000, base_dir='.', backdoor_port=0):
def stop(): def stop():
logging.info("Shutting down") logging.info("Shutting down")
server.stop() server.stop()
gevent.signal(signal.SIGTERM, stop) gevent.signal_handler(signal.SIGTERM, stop)
PromLogCountsHandler.install() PromLogCountsHandler.install()
install_stacksampler() install_stacksampler()

@ -565,7 +565,7 @@ def main(channels, base_dir='.', qualities='source', first_hour=None,
for manager in managers: for manager in managers:
manager.stop() manager.stop()
gevent.signal(signal.SIGTERM, stop) gevent.signal_handler(signal.SIGTERM, stop)
if backdoor_port: if backdoor_port:
gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start()

@ -387,7 +387,7 @@ def main(dbconnect, sheets_creds_file, edit_url, bustime_start, sheet_id, worksh
gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start()
stop = gevent.event.Event() stop = gevent.event.Event()
gevent.signal(signal.SIGTERM, stop.set) # shut down on sigterm gevent.signal_handler(signal.SIGTERM, stop.set) # shut down on sigterm
logging.info("Starting up") logging.info("Starting up")

@ -354,7 +354,7 @@ def main(connection_string, default_channel, bustime_start, host='0.0.0.0', port
# and when not # and when not
else: else:
sys.exit() sys.exit()
gevent.signal(signal.SIGTERM, stop) gevent.signal_handler(signal.SIGTERM, stop)
app.db_manager = database.DBManager(dsn=connection_string) app.db_manager = database.DBManager(dsn=connection_string)

Loading…
Cancel
Save