Skip to content

Commit

Permalink
refactor: use abort timeout
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Gillespie <[email protected]>
  • Loading branch information
goller and jacobwgillespie authored Nov 13, 2024
1 parent a7c3fa2 commit 6fa6e4f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/tasks/buildkit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,6 @@ async function shutdown(rootDir: string, task: RegisterMachineResponse_BuildKitT
}

async function reportShutdown() {
const controller = new AbortController()
const signal = controller.signal

const shutdown = client.shutdown({}, {signal})

const timeout = 5000
const timeoutId = setTimeout(() => controller.abort(), timeout)

return shutdown.finally(() => clearTimeout(timeoutId))
const signal = AbortSignal.timeout(5000)
return await client.shutdown({}, {signal})
}

0 comments on commit 6fa6e4f

Please sign in to comment.