mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-08-21 05:44:48 +00:00
fix cherry-pick error: restore CacheService.findOptionalUserById
This commit is contained in:
parent
84ca3621d8
commit
ec11092e8d
1 changed files with 5 additions and 0 deletions
|
@ -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 () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue