Merge pull request #3402 from lbryio/save_files_default_false

changed default setting `save_files` to be false
This commit is contained in:
Lex Berezhny 2021-08-19 10:57:51 -04:00 committed by GitHub
commit 69ea65835d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 8 deletions

View file

@ -704,7 +704,7 @@ class Config(CLIConfig):
blockchain_name = String("Blockchain name - lbrycrd_main, lbrycrd_regtest, or lbrycrd_testnet", 'lbrycrd_main') blockchain_name = String("Blockchain name - lbrycrd_main, lbrycrd_regtest, or lbrycrd_testnet", 'lbrycrd_main')
# daemon # daemon
save_files = Toggle("Save downloaded files when calling `get` by default", True) save_files = Toggle("Save downloaded files when calling `get` by default", False)
components_to_skip = Strings("components which will be skipped during start-up of daemon", []) components_to_skip = Strings("components which will be skipped during start-up of daemon", [])
share_usage_data = Toggle( share_usage_data = Toggle(
"Whether to share usage stats and diagnostic info with LBRY.", False, "Whether to share usage stats and diagnostic info with LBRY.", False,

View file

@ -353,6 +353,7 @@ class CommandTestCase(IntegrationTestCase):
self.server_config = Config( self.server_config = Config(
data_dir=server_tmp_dir, data_dir=server_tmp_dir,
wallet_dir=server_tmp_dir, wallet_dir=server_tmp_dir,
save_files=True,
download_dir=server_tmp_dir download_dir=server_tmp_dir
) )
self.server_config.transaction_cache_size = 10000 self.server_config.transaction_cache_size = 10000
@ -395,6 +396,7 @@ class CommandTestCase(IntegrationTestCase):
# needed during instantiation to access known_hubs path # needed during instantiation to access known_hubs path
data_dir=wallet_node.data_path, data_dir=wallet_node.data_path,
wallet_dir=wallet_node.data_path, wallet_dir=wallet_node.data_path,
save_files=True,
download_dir=wallet_node.data_path download_dir=wallet_node.data_path
) )
conf.upload_dir = upload_dir # not a real conf setting conf.upload_dir = upload_dir # not a real conf setting

View file

@ -20,7 +20,7 @@ from lbry.dht.peer import PeerManager, make_kademlia_peer
def mock_config(): def mock_config():
config = Config() config = Config(save_files=True)
config.fixed_peer_delay = 10000 config.fixed_peer_delay = 10000
return config return config
@ -34,15 +34,25 @@ class BlobExchangeTestBase(AsyncioTestCase):
self.addCleanup(shutil.rmtree, self.client_wallet_dir) self.addCleanup(shutil.rmtree, self.client_wallet_dir)
self.addCleanup(shutil.rmtree, self.client_dir) self.addCleanup(shutil.rmtree, self.client_dir)
self.addCleanup(shutil.rmtree, self.server_dir) self.addCleanup(shutil.rmtree, self.server_dir)
self.server_config = Config(data_dir=self.server_dir, download_dir=self.server_dir, wallet=self.server_dir, self.server_config = Config(
fixed_peers=[]) data_dir=self.server_dir,
download_dir=self.server_dir,
wallet=self.server_dir,
save_files=True,
fixed_peers=[]
)
self.server_config.transaction_cache_size = 10000 self.server_config.transaction_cache_size = 10000
self.server_storage = SQLiteStorage(self.server_config, os.path.join(self.server_dir, "lbrynet.sqlite")) self.server_storage = SQLiteStorage(self.server_config, os.path.join(self.server_dir, "lbrynet.sqlite"))
self.server_blob_manager = BlobManager(self.loop, self.server_dir, self.server_storage, self.server_config) self.server_blob_manager = BlobManager(self.loop, self.server_dir, self.server_storage, self.server_config)
self.server = BlobServer(self.loop, self.server_blob_manager, 'bQEaw42GXsgCAGio1nxFncJSyRmnztSCjP') self.server = BlobServer(self.loop, self.server_blob_manager, 'bQEaw42GXsgCAGio1nxFncJSyRmnztSCjP')
self.client_config = Config(data_dir=self.client_dir, download_dir=self.client_dir, self.client_config = Config(
wallet=self.client_wallet_dir, fixed_peers=[]) data_dir=self.client_dir,
download_dir=self.client_dir,
wallet=self.client_wallet_dir,
save_files=True,
fixed_peers=[]
)
self.client_config.transaction_cache_size = 10000 self.client_config.transaction_cache_size = 10000
self.client_storage = SQLiteStorage(self.client_config, os.path.join(self.client_dir, "lbrynet.sqlite")) self.client_storage = SQLiteStorage(self.client_config, os.path.join(self.client_dir, "lbrynet.sqlite"))
self.client_blob_manager = BlobManager(self.loop, self.client_dir, self.client_storage, self.client_config) self.client_blob_manager = BlobManager(self.loop, self.client_dir, self.client_storage, self.client_config)
@ -101,7 +111,7 @@ class TestBlobExchange(BlobExchangeTestBase):
second_client_dir = tempfile.mkdtemp() second_client_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, second_client_dir) self.addCleanup(shutil.rmtree, second_client_dir)
second_client_conf = Config() second_client_conf = Config(save_files=True)
second_client_storage = SQLiteStorage(second_client_conf, os.path.join(second_client_dir, "lbrynet.sqlite")) second_client_storage = SQLiteStorage(second_client_conf, os.path.join(second_client_dir, "lbrynet.sqlite"))
second_client_blob_manager = BlobManager( second_client_blob_manager = BlobManager(
self.loop, second_client_dir, second_client_storage, second_client_conf self.loop, second_client_dir, second_client_storage, second_client_conf
@ -196,7 +206,7 @@ class TestBlobExchange(BlobExchangeTestBase):
second_client_dir = tempfile.mkdtemp() second_client_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, second_client_dir) self.addCleanup(shutil.rmtree, second_client_dir)
second_client_conf = Config() second_client_conf = Config(save_files=True)
second_client_storage = SQLiteStorage(second_client_conf, os.path.join(second_client_dir, "lbrynet.sqlite")) second_client_storage = SQLiteStorage(second_client_conf, os.path.join(second_client_dir, "lbrynet.sqlite"))
second_client_blob_manager = BlobManager( second_client_blob_manager = BlobManager(

View file

@ -105,6 +105,7 @@ async def get_mock_wallet(sd_hash, storage, wallet_dir, balance=10.0, fee=None):
wallet.generate_account(ledger) wallet.generate_account(ledger)
manager = WalletManager() manager = WalletManager()
manager.config = Config() manager.config = Config()
manager.config.save_files = True
manager.config.transaction_cache_size = 10000 manager.config.transaction_cache_size = 10000
manager.wallets.append(wallet) manager.wallets.append(wallet)
manager.ledgers[Ledger] = ledger manager.ledgers[Ledger] = ledger