Merge pull request #2770 from lbryio/disable-save-content-claim

Add `save_resolved_claims` config setting for better performance when not using file_x commands
This commit is contained in:
Jack Robison 2020-02-06 11:32:49 -05:00 committed by GitHub
commit afb98f2cfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -616,6 +616,11 @@ class Config(CLIConfig):
"Strategy to use when selecting UTXOs for a transaction", "Strategy to use when selecting UTXOs for a transaction",
STRATEGIES, "standard") STRATEGIES, "standard")
save_resolved_claims = Toggle(
"Save content claims to the database when they are resolved to keep file_list up to date, "
"only disable this if file_x commands are not needed", True
)
@property @property
def streaming_host(self): def streaming_host(self):
return self.streaming_server.split(':')[0] return self.streaming_server.split(':')[0]

View file

@ -4853,7 +4853,7 @@ class Daemon(metaclass=JSONRPCServerType):
async def resolve(self, accounts, urls): async def resolve(self, accounts, urls):
results = await self.ledger.resolve(accounts, urls) results = await self.ledger.resolve(accounts, urls)
if results: if self.conf.save_resolved_claims and results:
try: try:
claims = self.stream_manager._convert_to_old_resolve_output(self.wallet_manager, results) claims = self.stream_manager._convert_to_old_resolve_output(self.wallet_manager, results)
await self.storage.save_claims_for_resolve([ await self.storage.save_claims_for_resolve([