From 22acb5707818a0e7c662971882b9c18ae8f7fb92 Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Wed, 24 Jul 2024 20:56:31 -0400 Subject: [PATCH] Improve throttling of profile fetching --- ts/services/profiles.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts/services/profiles.ts b/ts/services/profiles.ts index 3326b8c7b8..931ae8a336 100644 --- a/ts/services/profiles.ts +++ b/ts/services/profiles.ts @@ -329,6 +329,7 @@ async function doGetProfile(c: ConversationModel): Promise { } if (error.code === 404) { + c.set('profileLastFetchedAt', Date.now()); await c.removeLastProfile(lastProfile); } @@ -344,6 +345,7 @@ async function doGetProfile(c: ConversationModel): Promise { if (error instanceof HTTPError && error.code === 404) { log.info(`getProfile: failed to find a profile for ${idForLogging}`); + c.set('profileLastFetchedAt', Date.now()); await c.removeLastProfile(lastProfile); if (!isVersioned) { log.info(`getProfile: marking ${idForLogging} as unregistered`);