mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-13 19:08:52 +00:00
✨ feat: Instance grouping and user count
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import type { Instance } from "../../shared/types/instance";
|
||||
import { toInstance } from "./mappers";
|
||||
import { cachedRead } from "./cachedRead";
|
||||
import { cacheKeys, policies } from "../cache/policies";
|
||||
|
||||
export async function getInstance(worldId: string, instanceId: string): Promise<Instance> {
|
||||
return cachedRead(
|
||||
cacheKeys.instance(`${worldId}:${instanceId}`),
|
||||
policies.instance,
|
||||
async (vrc) => {
|
||||
const { data } = await vrc.getInstance({ path: { worldId, instanceId }, throwOnError: true });
|
||||
return toInstance(data);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user