Use signal.pause() instead of while True to keep Linspector running. A while True loop starts using 100% of one CPU when there is no sleep() inserted. That's not a good way to keep a program running. (0.20.3)
This commit is contained in:
parent
7360ab1936
commit
3078d125e8
2 changed files with 4 additions and 5 deletions
|
|
@ -8,6 +8,7 @@ See LICENSE.txt (MIT license).
|
|||
# Only exit execution on critical core errors. Do not exit when monitors are failing on
|
||||
# configuration and execution, but log these errors.
|
||||
import argparse
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from linspector.core.configuration import Configuration
|
||||
|
|
@ -16,7 +17,7 @@ from linspector.core.linspector import Linspector
|
|||
from linspector.core.logger import Log
|
||||
from linspector.core.monitors import Monitors
|
||||
|
||||
__version__ = '0.20.2'
|
||||
__version__ = '0.20.3'
|
||||
__author__ = 'Johannes Findeisen <you@hanez.org>'
|
||||
|
||||
|
||||
|
|
@ -101,8 +102,7 @@ def main():
|
|||
sys.exit(1)
|
||||
else:
|
||||
try:
|
||||
while True:
|
||||
pass
|
||||
signal.pause()
|
||||
except KeyboardInterrupt:
|
||||
log.info('[linspector] program terminated by user!')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue