forked from LBRYCommunity/lbry-sdk
non blocking save_claims
This commit is contained in:
parent
1c4c18dec9
commit
f461fc6ef9
1 changed files with 21 additions and 13 deletions
|
@ -2569,9 +2569,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
account.add_channel_private_key(txo.private_key)
|
account.add_channel_private_key(txo.private_key)
|
||||||
wallet.save()
|
wallet.save()
|
||||||
await self.broadcast_or_release(tx, blocking)
|
await self.broadcast_or_release(tx, blocking)
|
||||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
self.component_manager.loop.create_task(self.storage.save_claims([self._old_get_temp_claim_info(
|
||||||
tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
|
tx, txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||||
)])
|
)]))
|
||||||
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
||||||
else:
|
else:
|
||||||
await account.ledger.release_tx(tx)
|
await account.ledger.release_tx(tx)
|
||||||
|
@ -2725,9 +2725,9 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
account.add_channel_private_key(new_txo.private_key)
|
account.add_channel_private_key(new_txo.private_key)
|
||||||
wallet.save()
|
wallet.save()
|
||||||
await self.broadcast_or_release(tx, blocking)
|
await self.broadcast_or_release(tx, blocking)
|
||||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
self.component_manager.loop.create_task(self.storage.save_claims([self._old_get_temp_claim_info(
|
||||||
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
||||||
)])
|
)]))
|
||||||
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
self.component_manager.loop.create_task(self.analytics_manager.send_new_channel())
|
||||||
else:
|
else:
|
||||||
await account.ledger.release_tx(tx)
|
await account.ledger.release_tx(tx)
|
||||||
|
@ -3262,10 +3262,14 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
|
|
||||||
if not preview:
|
if not preview:
|
||||||
await self.broadcast_or_release(tx, blocking)
|
await self.broadcast_or_release(tx, blocking)
|
||||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
|
||||||
tx, new_txo, claim_address, claim, name, dewies_to_lbc(amount)
|
async def save_claims():
|
||||||
)])
|
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||||
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)
|
tx, new_txo, claim_address, claim, name, dewies_to_lbc(amount)
|
||||||
|
)])
|
||||||
|
await self.storage.save_content_claim(file_stream.stream_hash, new_txo.id)
|
||||||
|
|
||||||
|
self.component_manager.loop.create_task(save_claims())
|
||||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||||
else:
|
else:
|
||||||
await account.ledger.release_tx(tx)
|
await account.ledger.release_tx(tx)
|
||||||
|
@ -3480,11 +3484,15 @@ class Daemon(metaclass=JSONRPCServerType):
|
||||||
|
|
||||||
if not preview:
|
if not preview:
|
||||||
await self.broadcast_or_release(tx, blocking)
|
await self.broadcast_or_release(tx, blocking)
|
||||||
await self.storage.save_claims([self._old_get_temp_claim_info(
|
|
||||||
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
async def save_claims():
|
||||||
)])
|
await self.storage.save_claims([self._old_get_temp_claim_info(
|
||||||
if stream_hash:
|
tx, new_txo, claim_address, new_txo.claim, new_txo.claim_name, dewies_to_lbc(amount)
|
||||||
await self.storage.save_content_claim(stream_hash, new_txo.id)
|
)])
|
||||||
|
if stream_hash:
|
||||||
|
await self.storage.save_content_claim(stream_hash, new_txo.id)
|
||||||
|
|
||||||
|
self.component_manager.loop.create_task(save_claims())
|
||||||
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
self.component_manager.loop.create_task(self.analytics_manager.send_claim_action('publish'))
|
||||||
else:
|
else:
|
||||||
await account.ledger.release_tx(tx)
|
await account.ledger.release_tx(tx)
|
||||||
|
|
Loading…
Reference in a new issue