Skip to content

Commit b13406d

Browse files
committed
fix: restore sentry client and add logging
Signed-off-by: Sam Gammon <[email protected]>
1 parent 4d58cff commit b13406d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/diagnostics.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,15 @@ export async function error(err: Error | unknown, fatal = true): Promise<void> {
219219
* Exit hook for making sure Sentry finishes reporting.
220220
*/
221221
export async function onExit(): Promise<void> {
222-
await Sentry.close(2000)
222+
core.debug('Closing Sentry client')
223+
try {
224+
httpClient.dispose()
225+
} catch (err) {
226+
// Ignore.
227+
}
228+
try {
229+
await Sentry.close(2000)
230+
} catch (err) {
231+
// Ignore.
232+
}
223233
}

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ export async function entry(options?: Partial<Options>): Promise<void> {
586586

587587
try {
588588
await install(options || {}, true)
589+
await onExit()
589590
} catch (err) {
590591
core.warning(
591592
'Buildless failed to install; this build may not be accelerated. Please see CI logs for more information.'
@@ -604,6 +605,7 @@ export async function cleanup(options?: Partial<Options>): Promise<void> {
604605
try {
605606
await postExecute(options)
606607
core.info(`Thanks for using Buildless. 🎉`)
608+
await onExit()
607609
} catch (err) {
608610
core.notice(
609611
'Cleanup stage for the Buildless action failed. Please see CI logs for more information.'

0 commit comments

Comments
 (0)