[feature] rediscover beacon server after connection closing
I have a test environment which creates Beacon servers (and its sub processes) on-the-fly on random ports. When switching server I modify the BEACON_HOST
environment variable and close the connection to the previous server:
from bliss.config import static
config = static.get_config()
config.close()
However the connection instance of the in-memory configuration retains the Beacon host and port. To enforce rediscovery:
config = static.get_config()
config.close()
config._connection._host = None
config._connection._port = None
If this connection isn't closed very often in normal operation and/or discovery is not very costly, maybe this can be added to bliss.config.conductor.connection.Connection.close
?
Or perhaps as an option?
I thought I'd mention it as other non-BCU developers might run into this: finding the Beacon server is only done on the first connection. Anyway, this is probably only relevant for testing purposes.
Edited by Wout De Nolf