mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-22 15:52:13 +00:00
tools/scyllatop: leave terminal in a functioning state when user quits with CTRL-C
closes issue #1417. Signed-off-by: Yoav Kleinberger <yoav@scylladb.com> Message-Id: <1467556769-11851-1-git-send-email-yoav@scylladb.com>
This commit is contained in:
committed by
Avi Kivity
parent
386c0dd4b2
commit
49cba035ea
@@ -14,12 +14,6 @@ import signal
|
||||
import urwid
|
||||
|
||||
|
||||
def halt(* args):
|
||||
quit()
|
||||
|
||||
signal.signal(signal.SIGINT, halt)
|
||||
|
||||
|
||||
def shell():
|
||||
try:
|
||||
import IPython
|
||||
@@ -41,7 +35,10 @@ def main(metricPatterns, interval, collectd):
|
||||
liveDataThread = threading.Thread(target=lambda: liveData.go(loop))
|
||||
liveDataThread.daemon = True
|
||||
liveDataThread.start()
|
||||
loop.run()
|
||||
try:
|
||||
loop.run()
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
description = '\n'.join(['A top-like tool for scylladb collectd metrics.',
|
||||
|
||||
Reference in New Issue
Block a user