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,11 +51,14 @@ SPLASH = 'http://127.0.0.1:8050'
SANE_JS = 'http://127.0.0.1:5007'
if SANE_JS:
try:
sanejs = SaneJS(SANE_JS)
if sanejs.is_up:
has_sane_js = True
else:
has_sane_js = False
except Exception:
has_sane_js = False
r = Redis(unix_socket_path=get_socket_path('cache'), decode_responses=True)