(timeoutMs = 1000)
| 269 | } |
| 270 | |
| 271 | export async function stopAllVideoCaptureSessions(timeoutMs = 1000): Promise<{ |
| 272 | stoppedSessionCount: number; |
| 273 | errorCount: number; |
| 274 | errors: string[]; |
| 275 | }> { |
| 276 | const simulatorIds = Array.from(sessions.keys()); |
| 277 | const errors: string[] = []; |
| 278 | |
| 279 | for (const simulatorUuid of simulatorIds) { |
| 280 | const result = await stopSession(simulatorUuid, { timeoutMs }); |
| 281 | if ('error' in result) { |
| 282 | errors.push(`${simulatorUuid}: ${result.error}`); |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | return { |
| 287 | stoppedSessionCount: simulatorIds.length - errors.length, |
| 288 | errorCount: errors.length, |
| 289 | errors, |
| 290 | }; |
| 291 | } |
no test coverage detected