mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Merge pull request #362 from nahuhh/init_logging
init: adjust node startup log timing and types
This commit is contained in:
@@ -364,7 +364,7 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
"check_delayed_auto_accept_seconds", 60, 1, 20 * 60
|
"check_delayed_auto_accept_seconds", 60, 1, 20 * 60
|
||||||
)
|
)
|
||||||
self.startup_tries = self.get_int_setting(
|
self.startup_tries = self.get_int_setting(
|
||||||
"startup_tries", 21, 1, 100
|
"startup_tries", 15, 1, 100
|
||||||
) # Seconds waited for will be (x(1 + x+1) / 2
|
) # Seconds waited for will be (x(1 + x+1) / 2
|
||||||
self.debug_ui = self.settings.get("debug_ui", False)
|
self.debug_ui = self.settings.get("debug_ui", False)
|
||||||
self._debug_cases = []
|
self._debug_cases = []
|
||||||
@@ -1300,10 +1300,25 @@ class BasicSwap(BaseApp, BSXNetwork, UIApp):
|
|||||||
self.coin_clients[coin_type]["interface"].testDaemonRPC(with_wallet)
|
self.coin_clients[coin_type]["interface"].testDaemonRPC(with_wallet)
|
||||||
return
|
return
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.log.warning(
|
if any(
|
||||||
f"Can't connect to {Coins(coin_type).name} RPC: {ex}. Trying again in {1 + i} second/s, {1 + i}/{startup_tries}."
|
log in str(ex)
|
||||||
)
|
for log in [
|
||||||
self.delay_event.wait(1 + i)
|
"Verifying",
|
||||||
|
"Loading",
|
||||||
|
"Rewinding",
|
||||||
|
"Starting",
|
||||||
|
"Upgrading",
|
||||||
|
"Reaccepting",
|
||||||
|
]
|
||||||
|
):
|
||||||
|
self.log.info(
|
||||||
|
f"Waiting for {Coins(coin_type).name} RPC. Trying again in {5 * (1 + i)} seconds, {1 + i}/{startup_tries}."
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
self.log.warning(
|
||||||
|
f"Can't connect to {Coins(coin_type).name} RPC: {ex}. Trying again in {5 * (1 + i)} seconds, {1 + i}/{startup_tries}."
|
||||||
|
)
|
||||||
|
self.delay_event.wait(5 * (1 + i))
|
||||||
self.log.error(f"Can't connect to {Coins(coin_type).name} RPC, exiting.")
|
self.log.error(f"Can't connect to {Coins(coin_type).name} RPC, exiting.")
|
||||||
self.stopRunning(1) # systemd will try to restart the process if fail_code != 0
|
self.stopRunning(1) # systemd will try to restart the process if fail_code != 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user