mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-18 14:44:21 +01:00
Handling errors when constructing the Watcher in pisa daemon
This commit is contained in:
@@ -29,13 +29,16 @@ if __name__ == '__main__':
|
|||||||
# FIXME: Leaving this here for future option/arguments
|
# FIXME: Leaving this here for future option/arguments
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if can_connect_to_bitcoind():
|
try:
|
||||||
if in_correct_network(BTC_NETWORK):
|
if can_connect_to_bitcoind():
|
||||||
# Fire the api
|
if in_correct_network(BTC_NETWORK):
|
||||||
start_api()
|
# Fire the api
|
||||||
|
start_api()
|
||||||
|
|
||||||
|
else:
|
||||||
|
logger.error("bitcoind is running on a different network, check conf.py and bitcoin.conf. Shutting down")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.error("bitcoind is running on a different network, check conf.py and bitcoin.conf. Shutting down")
|
logger.error("Can't connect to bitcoind. Shutting down")
|
||||||
|
except Exception e:
|
||||||
else:
|
logger.error("There was an error while starting the daemon. Shutting down", error_args=e.args)
|
||||||
logger.error("Can't connect to bitcoind. Shutting down")
|
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ class Watcher:
|
|||||||
self.max_appointments = max_appointments
|
self.max_appointments = max_appointments
|
||||||
self.zmq_subscriber = None
|
self.zmq_subscriber = None
|
||||||
self.responder = Responder()
|
self.responder = Responder()
|
||||||
if SIGNING_KEY_FILE is not None:
|
|
||||||
self.signing_key = SigningKey.from_pem(open(SIGNING_KEY_FILE).read())
|
if SIGNING_KEY_FILE is None:
|
||||||
|
raise ValueError("No signing key provided. Please fix your pisa.conf")
|
||||||
else:
|
else:
|
||||||
self.signing_key = None
|
self.signing_key = SigningKey.from_pem(open(SIGNING_KEY_FILE).read())
|
||||||
logger.warning("No signing key provided. Appointments will not be signed.")
|
|
||||||
|
|
||||||
def add_appointment(self, appointment):
|
def add_appointment(self, appointment):
|
||||||
# Rationale:
|
# Rationale:
|
||||||
|
|||||||
Reference in New Issue
Block a user