(
earlyExit?: boolean | undefined
)
| 79 | } |
| 80 | |
| 81 | export async function saveOnlyRun( |
| 82 | earlyExit?: boolean | undefined |
| 83 | ): Promise<void> { |
| 84 | try { |
| 85 | const cacheId = await saveImpl(new NullStateProvider()); |
| 86 | if (cacheId === -1) { |
| 87 | // The toolkit's saveCache already logs the underlying reason at |
| 88 | // the appropriate severity (warning for most failures, info for |
| 89 | // benign concurrency races, error for 5xx). Avoid emitting a |
| 90 | // generic warning here that would duplicate or mask that signal. |
| 91 | core.debug(`Cache was not saved.`); |
| 92 | } |
| 93 | } catch (err) { |
| 94 | console.error(err); |
| 95 | if (earlyExit) { |
| 96 | process.exit(1); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | // node will stay alive if any promises are not resolved, |
| 101 | // which is a possibility if HTTP requests are dangling |
| 102 | // due to retries or timeouts. We know that if we got here |
| 103 | // that all promises that we care about have successfully |
| 104 | // resolved, so simply exit with success. |
| 105 | if (earlyExit) { |
| 106 | process.exit(0); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | export async function saveRun(earlyExit?: boolean | undefined): Promise<void> { |
| 111 | try { |
no test coverage detected
searching dependent graphs…