MCPcopy Create free account
hub / github.com/esmBot/esmBot / getCount

Method getCount

src/utils/mediaConnection.ts:197–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

195 }
196
197 async getCount() {
198 const controller = new AbortController();
199 const timeout = setTimeout(() => {
200 controller.abort();
201 }, 1000);
202 const req = await fetch(`${this.httpurl}/count`, {
203 signal: controller.signal,
204 headers: this.auth
205 ? {
206 authentication: this.auth,
207 }
208 : undefined,
209 });
210 clearTimeout(timeout);
211 if (req.status !== 200) return -1;
212 const res = Number.parseInt(await req.text());
213 return res;
214 }
215
216 do<T>(op: number, id: bigint, data: Buffer): Promise<T> {
217 const buf = Buffer.alloc(1 + 2);

Callers 2

runMethod · 0.80
getIdealFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected