MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / releaseSession

Function releaseSession

scripts/studio-host-provider.mjs:300–320  ·  view source on GitHub ↗
(config, state, job)

Source from the content-addressed store, hash-verified

298}
299
300async function releaseSession(config, state, job) {
301 const payload = job.payload || {};
302 const udid =
303 payload.simulatorUdid ||
304 state.activeSessions.get(job.sessionId)?.udid ||
305 "";
306 if (udid) {
307 await localJson(
308 config,
309 `/api/simulators/${encodeURIComponent(udid)}/shutdown`,
310 {},
311 ).catch(() => {});
312 await deleteSimulator(udid);
313 }
314 state.activeSessions.delete(job.sessionId);
315 await completeJob(config, job.id, {
316 activeSessionCount: state.activeSessions.size,
317 status: "completed",
318 });
319 console.log(`[simdeck-provider] released ${job.sessionId}`);
320}
321
322async function pollRpc(config, state) {
323 const response = await studioJson(

Callers 1

handleJobFunction · 0.85

Calls 6

deleteSimulatorFunction · 0.85
completeJobFunction · 0.85
logMethod · 0.80
localJsonFunction · 0.70
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected