(config, state, job)
| 298 | } |
| 299 | |
| 300 | async 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 | |
| 322 | async function pollRpc(config, state) { |
| 323 | const response = await studioJson( |
no test coverage detected