fix cherry-pick error: restore CacheService.findOptionalUserById

This commit is contained in:
Hazelnoot 2025-07-26 18:47:33 -04:00
parent 534a25ddbf
commit 924528749b

View file

@ -398,6 +398,11 @@ export class CacheService implements OnApplicationShutdown {
return user as MiRemoteUser;
}
@bindThis
public findOptionalUserById(userId: MiUser['id']) {
return this.userByIdCache.fetchMaybe(userId, async () => await this.usersRepository.findOneBy({ id: userId }) ?? undefined);
}
@bindThis
public async getFollowStats(userId: MiUser['id']): Promise<FollowStats> {
return await this.userFollowStatsCache.fetch(userId, async () => {