diff --git a/lbry/blob/disk_space_manager.py b/lbry/blob/disk_space_manager.py index b237d858fe..13294f0dc3 100644 --- a/lbry/blob/disk_space_manager.py +++ b/lbry/blob/disk_space_manager.py @@ -43,7 +43,7 @@ async def _clean(self, is_network_blob=False): space_used_mb = space_used_mb['content_storage'] + space_used_mb['private_storage'] storage_limit_mb = self.config.network_storage_limit if is_network_blob else self.config.blob_storage_limit if self.analytics: - asyncio.create_task( + task = asyncio.create_task( self.analytics.send_disk_space_used(space_used_mb, storage_limit_mb, is_network_blob) ) delete = [] diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 240582c81c..c4aa23d839 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -1383,7 +1383,7 @@ async def jsonrpc_wallet_import(self, data, password=None, wallet_id=None, block ]) else: for new_account in added_accounts: - asyncio.create_task(self.ledger.subscribe_account(new_account)) + task = asyncio.create_task(self.ledger.subscribe_account(new_account)) wallet.save() return await self.jsonrpc_wallet_export(password=password, wallet_id=wallet_id) @@ -2001,7 +2001,7 @@ async def jsonrpc_sync_apply(self, password, data=None, wallet_id=None, blocking ]) else: for new_account in added_accounts: - asyncio.create_task(self.ledger.subscribe_account(new_account)) + task = asyncio.create_task(self.ledger.subscribe_account(new_account)) wallet_changed = True if wallet.preferences.get(ENCRYPT_ON_DISK, False) and password != wallet.encryption_password: wallet.encryption_password = password diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 88bee190e4..007c4e10df 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -334,7 +334,7 @@ async def start(self): self.headers.open() ])) fully_synced = self.on_ready.first - asyncio.create_task(self.network.start()) + task = asyncio.create_task(self.network.start()) await self.network.on_connected.first async with self._header_processing_lock: await self._update_tasks.add(self.initial_headers_sync()) diff --git a/tests/unit/components/test_component_manager.py b/tests/unit/components/test_component_manager.py index 269591d8e5..04d837f9f6 100644 --- a/tests/unit/components/test_component_manager.py +++ b/tests/unit/components/test_component_manager.py @@ -170,7 +170,7 @@ def setUp(self): ) async def test_proper_starting_of_components(self): - asyncio.create_task(self.component_manager.start()) + task = asyncio.create_task(self.component_manager.start()) await self.advance(0) self.assertTrue(self.component_manager.get_component('wallet').running) @@ -188,7 +188,7 @@ async def test_proper_starting_of_components(self): self.assertTrue(self.component_manager.get_component('file_manager').running) async def test_proper_stopping_of_components(self): - asyncio.create_task(self.component_manager.start()) + task = asyncio.create_task(self.component_manager.start()) await self.advance(0) await self.advance(1) await self.advance(1) @@ -196,7 +196,7 @@ async def test_proper_stopping_of_components(self): self.assertTrue(self.component_manager.get_component('blob_manager').running) self.assertTrue(self.component_manager.get_component('file_manager').running) - asyncio.create_task(self.component_manager.stop()) + task = asyncio.create_task(self.component_manager.stop()) await self.advance(0) self.assertFalse(self.component_manager.get_component('file_manager').running) self.assertTrue(self.component_manager.get_component('blob_manager').running)