MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / initAndCache

Function initAndCache

packages/hydrooj/src/model/user.ts:193–199  ·  view source on GitHub ↗
(udoc: Udoc, dudoc, scope: bigint = PERM.PERM_ALL)

Source from the content-addressed store, hash-verified

191}
192
193async function initAndCache(udoc: Udoc, dudoc, scope: bigint = PERM.PERM_ALL) {
194 const res = await new User(udoc, dudoc, scope).init();
195 cache.set(`id/${udoc._id}/${dudoc.domainId}`, res);
196 cache.set(`name/${udoc.unameLower}/${dudoc.domainId}`, res);
197 cache.set(`mail/${udoc.mailLower}/${dudoc.domainId}`, res);
198 return res;
199}
200
201class UserModel {
202 static coll = coll;

Callers 3

getByIdMethod · 0.85
getByUnameMethod · 0.85
getByEmailMethod · 0.85

Calls 2

initMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected