From 86f7823348e20c5e374b110a1b28e156e16ee3ef Mon Sep 17 00:00:00 2001 From: HubbeKing Date: Mon, 19 Oct 2020 22:09:13 +0300 Subject: [PATCH] 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 --- backfiller/backfiller/main.py | 2 +- cutter/cutter/main.py | 2 +- downloader/downloader/main.py | 2 +- restreamer/restreamer/main.py | 2 +- segment_coverage/segment_coverage/main.py | 2 +- sheetsync/sheetsync/main.py | 2 +- thrimshim/thrimshim/main.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index 365f2ff..a603c9a 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -573,7 +573,7 @@ def main(channels, base_dir='.', qualities='source', metrics_port=8002, def stop(): manager.stop() - gevent.signal(signal.SIGTERM, stop) + gevent.signal_handler(signal.SIGTERM, stop) if backdoor_port: gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() diff --git a/cutter/cutter/main.py b/cutter/cutter/main.py index e47ba2b..47ee46c 100644 --- a/cutter/cutter/main.py +++ b/cutter/cutter/main.py @@ -603,7 +603,7 @@ def main( tags = tags.split(',') if tags else [] 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") diff --git a/downloader/downloader/main.py b/downloader/downloader/main.py index 0f5979f..cc3199a 100644 --- a/downloader/downloader/main.py +++ b/downloader/downloader/main.py @@ -604,7 +604,7 @@ def main(channels, base_dir=".", qualities="source", metrics_port=8001, backdoor for manager in managers: 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.install_stacksampler() diff --git a/restreamer/restreamer/main.py b/restreamer/restreamer/main.py index 5d747a6..bef5c72 100644 --- a/restreamer/restreamer/main.py +++ b/restreamer/restreamer/main.py @@ -332,7 +332,7 @@ def main(host='0.0.0.0', port=8000, base_dir='.', backdoor_port=0): def stop(): logging.info("Shutting down") server.stop() - gevent.signal(signal.SIGTERM, stop) + gevent.signal_handler(signal.SIGTERM, stop) PromLogCountsHandler.install() install_stacksampler() diff --git a/segment_coverage/segment_coverage/main.py b/segment_coverage/segment_coverage/main.py index 6ff3339..d0fb297 100644 --- a/segment_coverage/segment_coverage/main.py +++ b/segment_coverage/segment_coverage/main.py @@ -565,7 +565,7 @@ def main(channels, base_dir='.', qualities='source', first_hour=None, for manager in managers: manager.stop() - gevent.signal(signal.SIGTERM, stop) + gevent.signal_handler(signal.SIGTERM, stop) if backdoor_port: gevent.backdoor.BackdoorServer(('127.0.0.1', backdoor_port), locals=locals()).start() diff --git a/sheetsync/sheetsync/main.py b/sheetsync/sheetsync/main.py index 004627e..066e24b 100644 --- a/sheetsync/sheetsync/main.py +++ b/sheetsync/sheetsync/main.py @@ -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() 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") diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index 1e7405a..35dc3ed 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -354,7 +354,7 @@ def main(connection_string, default_channel, bustime_start, host='0.0.0.0', port # and when not else: sys.exit() - gevent.signal(signal.SIGTERM, stop) + gevent.signal_handler(signal.SIGTERM, stop) app.db_manager = database.DBManager(dsn=connection_string)