(
client: DaemonClient,
socketPath: string,
workspaceRoot: string,
foreground: boolean,
logOpts: { logPath?: string; logLevel?: string },
)
| 220 | } |
| 221 | |
| 222 | async function handleRestart( |
| 223 | client: DaemonClient, |
| 224 | socketPath: string, |
| 225 | workspaceRoot: string, |
| 226 | foreground: boolean, |
| 227 | logOpts: { logPath?: string; logLevel?: string }, |
| 228 | ): Promise<void> { |
| 229 | // Try to stop existing daemon |
| 230 | try { |
| 231 | const isRunning = await client.isRunning(); |
| 232 | if (isRunning) { |
| 233 | writeLine('Stopping existing daemon...'); |
| 234 | await client.stop(); |
| 235 | // Wait for it to fully stop |
| 236 | await new Promise((resolve) => setTimeout(resolve, 500)); |
| 237 | } |
| 238 | } catch { |
| 239 | // Ignore errors during stop |
| 240 | } |
| 241 | |
| 242 | // Start new daemon |
| 243 | await handleStart(socketPath, workspaceRoot, foreground, logOpts); |
| 244 | } |
| 245 | |
| 246 | interface DaemonListEntry { |
| 247 | workspaceKey: string; |
no test coverage detected