fix last time limit for public key refetch

This commit is contained in:
Hazelnoot 2025-11-14 19:32:03 -05:00
parent 0b6f029467
commit 36835b4a2e

View file

@ -130,9 +130,9 @@ export class ApDbResolverService implements OnApplicationShutdown {
@bindThis
public async refetchPublicKeyForApId(user: MiRemoteUser): Promise<MiUserPublickey | null> {
// Don't re-fetch if we've updated the user recently
const maxUpdatedTime = this.timeService.now - 60_000; // 1 minute ago
if (
(user.lastFetchedAt && user.lastFetchedAt.valueOf() > maxUpdatedTime) ||
const maxUpdatedTime = this.timeService.now - (1000 * 60 * 60); // 1 hour
(user.updatedAt && user.updatedAt.valueOf() > maxUpdatedTime) ||
this.idService.parse(user.id).date.valueOf() > maxUpdatedTime
) {