fix: Make sure sanejs is optional

pull/27/head
Raphaël Vinot 2019-01-30 13:14:16 +01:00
parent 6bc316ebcf
commit e5de1a9958
1 changed files with 7 additions and 4 deletions

View File

@ -51,10 +51,13 @@ SPLASH = 'http://127.0.0.1:8050'
SANE_JS = 'http://127.0.0.1:5007' SANE_JS = 'http://127.0.0.1:5007'
if SANE_JS: if SANE_JS:
sanejs = SaneJS(SANE_JS) try:
if sanejs.is_up: sanejs = SaneJS(SANE_JS)
has_sane_js = True if sanejs.is_up:
else: has_sane_js = True
else:
has_sane_js = False
except Exception:
has_sane_js = False has_sane_js = False
r = Redis(unix_socket_path=get_socket_path('cache'), decode_responses=True) r = Redis(unix_socket_path=get_socket_path('cache'), decode_responses=True)