Ignore ps errors

This commit is contained in:
Théophile Bastian 2018-07-31 17:06:01 +02:00
parent d43e6174a2
commit 720e274c24

View file

@ -12,7 +12,7 @@ LOGGER_NAME = __name__
app = Flask(__name__) app = Flask(__name__)
@app.route('/', methods=['GET']) @app.route('/health', methods=['GET'])
def home_view(): def home_view():
# We check whether weechat is running # We check whether weechat is running
url_regex = re.compile( url_regex = re.compile(
@ -30,8 +30,8 @@ def home_view():
for line in lines: for line in lines:
if line.strip() == settings.PS_COMMAND: if line.strip() == settings.PS_COMMAND:
return 'OK\n', 200 return 'OK\n', 200
except subprocess.CalledProcessError as exn: except subprocess.CalledProcessError:
return 'Internal error: {}\n'.format(exn), 500 pass
return 'Weechat not running\n', 406 return 'Weechat not running\n', 406