( req: Omit<DaemonRequest, 'token'>, )
| 122 | } |
| 123 | |
| 124 | export function resolveDaemonRequestTimeoutMs( |
| 125 | req: Omit<DaemonRequest, 'token'>, |
| 126 | ): number | undefined { |
| 127 | if (req.command === PUBLIC_COMMANDS.test) return undefined; |
| 128 | if (typeof req.flags?.timeoutMs === 'number' && isExplicitTimeoutCommand(req.command)) { |
| 129 | return req.flags.timeoutMs; |
| 130 | } |
| 131 | if (req.command === PUBLIC_COMMANDS.prepare) return PREPARE_REQUEST_TIMEOUT_MS; |
| 132 | if (isInstallLikeCommand(req.command)) return INSTALL_REQUEST_TIMEOUT_MS; |
| 133 | return DAEMON_REQUEST_TIMEOUT_MS; |
| 134 | } |
| 135 | |
| 136 | function isExplicitTimeoutCommand(command: string | undefined): boolean { |
| 137 | return ( |
no test coverage detected