fix test
This commit is contained in:
parent
46ce175481
commit
d7e50b269f
2 changed files with 5 additions and 4 deletions
|
@ -218,7 +218,7 @@ class BlockchainReaderServer(BlockchainReader):
|
|||
t = self.cancellable_tasks.pop()
|
||||
if not t.done():
|
||||
t.cancel()
|
||||
self.session_manager.search_index.stop()
|
||||
await self.session_manager.search_index.stop()
|
||||
self.db.close()
|
||||
if self.prometheus_server:
|
||||
await self.prometheus_server.stop()
|
||||
|
|
|
@ -92,10 +92,11 @@ class SearchIndex:
|
|||
await self.sync_client.indices.refresh(self.index)
|
||||
return acked
|
||||
|
||||
def stop(self):
|
||||
clients = [self.sync_client, self.search_client]
|
||||
async def stop(self):
|
||||
clients = [c for c in (self.sync_client, self.search_client) if c is not None]
|
||||
self.sync_client, self.search_client = None, None
|
||||
return asyncio.ensure_future(asyncio.gather(*(client.close() for client in clients)))
|
||||
if clients:
|
||||
await asyncio.gather(*(client.close() for client in clients))
|
||||
|
||||
def delete_index(self):
|
||||
return self.sync_client.indices.delete(self.index, ignore_unavailable=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue