queue_processors: Log time spent getting data for url in embed_links.

This commit is contained in:
Mateusz Mandera 2020-05-21 16:15:38 +02:00 committed by Tim Abbott
parent e59a2a23c3
commit e2262b0b64
1 changed files with 2 additions and 0 deletions

View File

@ -539,7 +539,9 @@ class TestWorker(QueueProcessingWorker):
class FetchLinksEmbedData(QueueProcessingWorker):
def consume(self, event: Mapping[str, Any]) -> None:
for url in event['urls']:
start_time = time.time()
url_preview.get_link_embed_data(url)
logging.info("Time spent on get_link_embed_data for %s: %s", url, time.time() - start_time)
message = Message.objects.get(id=event['message_id'])
# If the message changed, we will run this task after updating the message