MCPcopy Index your code
hub / github.com/callstack/agent-device / cleanupForcedPreviousConnection

Function cleanupForcedPreviousConnection

src/cli/commands/connection.ts:263–273  ·  view source on GitHub ↗
(
  client: Parameters<ClientCommandHandler>[0]['client'],
  stateDir: string,
  flags: CliFlags,
  previous: RemoteConnectionState | null,
)

Source from the content-addressed store, hash-verified

261}
262
263async function cleanupForcedPreviousConnection(
264 client: Parameters<ClientCommandHandler>[0]['client'],
265 stateDir: string,
266 flags: CliFlags,
267 previous: RemoteConnectionState | null,
268): Promise<void> {
269 if (!previous || !flags.force) return;
270 await stopMetroCleanup(previous.metro);
271 await stopReactDevtoolsCleanup({ stateDir, state: previous });
272 await releasePreviousLease(client, previous);
273}
274
275function resolveRemoteConnectFlags(flags: CliFlags): {
276 flags: CliFlags;

Callers 1

connectCommandFunction · 0.85

Calls 3

stopMetroCleanupFunction · 0.90
stopReactDevtoolsCleanupFunction · 0.90
releasePreviousLeaseFunction · 0.90

Tested by

no test coverage detected