secrets fix
This commit is contained in:
parent
7d920907cc
commit
45374987e7
|
|
@ -66,33 +66,33 @@ def _init_seed_via_db() -> bytes:
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
seed = read_seed()
|
seed = read_seed()
|
||||||
if seed:
|
if seed:
|
||||||
return seed
|
return seed
|
||||||
|
|
||||||
if role == "primary":
|
if role == "primary":
|
||||||
seed = _load_seed_from_env_or_generate()
|
seed = _load_seed_from_env_or_generate()
|
||||||
# Try insert; if another primary raced, ignore
|
# Try insert; if another primary raced, ignore
|
||||||
try:
|
try:
|
||||||
with engine.connect() as wconn:
|
with engine.connect() as wconn:
|
||||||
with Session(bind=wconn) as s:
|
with Session(bind=wconn) as s:
|
||||||
s.add(ServiceConfigValue(key='private_key', packed_value={"value": seed.hex()}))
|
s.add(ServiceConfigValue(key='private_key', packed_value={"value": seed.hex()}))
|
||||||
s.commit()
|
s.commit()
|
||||||
make_log("HotWallet", "Seed saved in service_config by primary", level='info')
|
make_log("HotWallet", "Seed saved in service_config by primary", level='info')
|
||||||
|
return seed
|
||||||
|
except Exception:
|
||||||
|
# Read again in case of race
|
||||||
|
seed2 = read_seed()
|
||||||
|
if seed2:
|
||||||
|
return seed2
|
||||||
|
raise
|
||||||
|
else:
|
||||||
|
make_log("HotWallet", "Worker waiting for seed in service_config...", level='info')
|
||||||
|
while True:
|
||||||
|
seed = read_seed()
|
||||||
|
if seed:
|
||||||
return seed
|
return seed
|
||||||
except Exception:
|
time.sleep(0.5)
|
||||||
# Read again in case of race
|
|
||||||
seed2 = read_seed()
|
|
||||||
if seed2:
|
|
||||||
return seed2
|
|
||||||
raise
|
|
||||||
else:
|
|
||||||
make_log("HotWallet", "Worker waiting for seed in service_config...", level='info')
|
|
||||||
while True:
|
|
||||||
seed = read_seed()
|
|
||||||
if seed:
|
|
||||||
return seed
|
|
||||||
time.sleep(0.5)
|
|
||||||
|
|
||||||
|
|
||||||
_extra_ton_wallet_options = {}
|
_extra_ton_wallet_options = {}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue