From f1d7560098509d825154f6c992049cd7d51ebc6b Mon Sep 17 00:00:00 2001 From: jessop Date: Sat, 1 Aug 2020 08:46:35 -0400 Subject: [PATCH] resolve comments faster by batching maybe --- lbry/extras/daemon/daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 2796719e2..6b9a1fc0a 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -5058,11 +5058,15 @@ class Daemon(metaclass=JSONRPCServerType): top_level=not include_replies ) if not skip_validation: + channel_urls = [] + for comment in result.get('items', []): + channel_url = comment.get('channel_url') + if channel_url: + channel_urls.append(channel_url) + resolve_response = await self.resolve([], channel_urls) + for comment in result.get('items', []): channel_url = comment.get('channel_url') - if not channel_url: - continue - resolve_response = await self.resolve([], [channel_url]) if isinstance(resolve_response[channel_url], Output): comment['is_channel_signature_valid'] = comment_client.is_comment_signed_by_channel( comment, resolve_response[channel_url]