Improve throttling of profile fetching

This commit is contained in:
trevor-signal 2024-07-24 20:56:31 -04:00 committed by GitHub
parent 92ca681d3a
commit 22acb57078
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -329,6 +329,7 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
}
if (error.code === 404) {
c.set('profileLastFetchedAt', Date.now());
await c.removeLastProfile(lastProfile);
}
@ -344,6 +345,7 @@ async function doGetProfile(c: ConversationModel): Promise<void> {
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`);