1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 12:14:18 +00:00

fix cherry-pick error: restore CacheService.findOptionalUserById

This commit is contained in:
Hazelnoot
2025-07-26 18:47:33 -04:00
committed by dakkar
parent 84ca3621d8
commit ec11092e8d

View File

@@ -350,6 +350,11 @@ export class CacheService implements OnApplicationShutdown {
}) ?? null;
}
@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 () => {