From b56dbd19f96dd59e54c89be0f38295060e3ba9de Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 8 Aug 2022 10:35:26 -0400 Subject: [PATCH] --exit-on-disconnect flag to start lbrynet --- lbry/conf.py | 3 +++ lbry/wallet/manager.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lbry/conf.py b/lbry/conf.py index d2dc8bb3a..67e2b416d 100644 --- a/lbry/conf.py +++ b/lbry/conf.py @@ -574,6 +574,9 @@ class TranscodeConfig(BaseConfig): class CLIConfig(TranscodeConfig): api = String('Host name and port for lbrynet daemon API.', 'localhost:5279', metavar='HOST:PORT') + exit_on_disconnect = Toggle( + 'Shutdown daemon when connection to wallet server closes.', False + ) @property def api_connection_url(self) -> str: diff --git a/lbry/wallet/manager.py b/lbry/wallet/manager.py index 911adcf87..557c62a3e 100644 --- a/lbry/wallet/manager.py +++ b/lbry/wallet/manager.py @@ -190,7 +190,8 @@ class WalletManager: 'jurisdiction': config.jurisdiction, 'concurrent_hub_requests': config.concurrent_hub_requests, 'data_path': config.wallet_dir, - 'tx_cache_size': config.transaction_cache_size + 'tx_cache_size': config.transaction_cache_size, + 'exit_on_disconnect': config.exit_on_disconnect, } if 'LBRY_FEE_PER_NAME_CHAR' in os.environ: ledger_config['fee_per_name_char'] = int(os.environ.get('LBRY_FEE_PER_NAME_CHAR')) @@ -244,6 +245,7 @@ class WalletManager: 'hub_timeout': self.config.hub_timeout, 'concurrent_hub_requests': self.config.concurrent_hub_requests, 'data_path': self.config.wallet_dir, + 'exit_on_disconnect': self.config.exit_on_disconnect, } if Config.lbryum_servers.is_set(self.config): self.ledger.config['explicit_servers'] = self.config.lbryum_servers