perf: add new user to cache
This commit is contained in:
parent
9c65f0078b
commit
c47e125413
1 changed files with 3 additions and 1 deletions
|
@ -28,7 +28,7 @@ import { fetchInstanceMetadata } from "@/services/fetch-instance-metadata.js";
|
|||
import { normalizeForSearch } from "@/misc/normalize-for-search.js";
|
||||
import { truncate } from "@/misc/truncate.js";
|
||||
import { StatusError } from "@/misc/fetch.js";
|
||||
import { uriPersonCache } from "@/services/user-cache.js";
|
||||
import { uriPersonCache, userByIdCache } from "@/services/user-cache.js";
|
||||
import { publishInternalEvent } from "@/services/stream.js";
|
||||
import { db } from "@/db/postgre.js";
|
||||
import { apLogger } from "../logger.js";
|
||||
|
@ -373,6 +373,8 @@ export async function createPerson(
|
|||
|
||||
await updateFeatured(user!.id, resolver).catch((err) => logger.error(err));
|
||||
|
||||
await userByIdCache.set(user.id, {...user, emojis, avatar, banner});
|
||||
|
||||
return user!;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue