mirror of
https://github.com/bendtherules/pytest_gui_status.git
synced 2026-08-18 21:52:18 +00:00
Stop gui when cant connect to redis
This commit is contained in:
@@ -38,19 +38,22 @@ class Controller(htmlPy.Object):
|
|||||||
try:
|
try:
|
||||||
assert redis_db.ping()
|
assert redis_db.ping()
|
||||||
except redis.exceptions.ConnectionError:
|
except redis.exceptions.ConnectionError:
|
||||||
|
self.app_gui.stop()
|
||||||
raise redis.exceptions.ConnectionError("Cant connect to this socket. Is redis running?\n"
|
raise redis.exceptions.ConnectionError("Cant connect to this socket. Is redis running?\n"
|
||||||
"Couldnt start pytest_status_gui")
|
"Stopping pytest_status_gui")
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
|
self.app_gui.stop()
|
||||||
raise redis.exceptions.ConnectionError("Cant connect to redis, something else seems to be running on this socket. "
|
raise redis.exceptions.ConnectionError("Cant connect to redis, something else seems to be running on this socket. "
|
||||||
"Is redis running?\n"
|
"Is redis running?\n"
|
||||||
"Couldnt start pytest_status_gui")
|
"Stopping pytest_status_gui")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# make sure that this is correct redis db
|
# make sure that this is correct redis db
|
||||||
assert redis_db.get("PYTEST_STATUS_DB") == "1"
|
assert redis_db.get("PYTEST_STATUS_DB") == "1"
|
||||||
except AssertionError:
|
except AssertionError:
|
||||||
|
self.app_gui.stop()
|
||||||
raise redis.exceptions.ConnectionError("Redis is running on this port, but it is not related to pytest status\n"
|
raise redis.exceptions.ConnectionError("Redis is running on this port, but it is not related to pytest status\n"
|
||||||
"Couldnt start pytest_status_gui")
|
"Stopping pytest_status_gui")
|
||||||
|
|
||||||
dir_name = self.app_gui.dir_name
|
dir_name = self.app_gui.dir_name
|
||||||
hash_dir_name = redis_db.hget("directories_to_hash", dir_name)
|
hash_dir_name = redis_db.hget("directories_to_hash", dir_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user