Add backup mongo URLs
Created by: jorana
What is the problem / what does the code in this PR do Use Chicago and xenon1t-daq.lngs.infn.it as backup mongo instances for fried-rice.
Use fried-rice always as the first default as that is accessible outside dali
Can you briefly describe how it works?
Try to connect to fried-rice, if it doesn't use a backup_mongo_url
Can you give a minimal working example (or illustrate with a figure)?
import strax
import straxen
RunDB = <see PR>
st = strax.Context(
config=straxen.contexts.xnt_common_config,
**straxen.contexts.common_opts)
username = straxen.get_secret('rundb_username')
password = straxen.get_secret('rundb_password')
st.storage = [RunDB(
readonly=True,
runid_field='number',
new_data_path='./strax_data',
)
]
st.storage[0].client['xenonnt'].command('ping')
Difference with #212 Rather than having all tree in a single URL we split it to a to stage initialization. Otherwise if not on dali it cannot find the primary host.