(earlyExit?: boolean | undefined)
| 108 | } |
| 109 | |
| 110 | export async function saveRun(earlyExit?: boolean | undefined): Promise<void> { |
| 111 | try { |
| 112 | await saveImpl(new StateProvider()); |
| 113 | } catch (err) { |
| 114 | console.error(err); |
| 115 | if (earlyExit) { |
| 116 | process.exit(1); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // node will stay alive if any promises are not resolved, |
| 121 | // which is a possibility if HTTP requests are dangling |
| 122 | // due to retries or timeouts. We know that if we got here |
| 123 | // that all promises that we care about have successfully |
| 124 | // resolved, so simply exit with success. |
| 125 | if (earlyExit) { |
| 126 | process.exit(0); |
| 127 | } |
| 128 | } |
no test coverage detected
searching dependent graphs…