Skip to content

Commit

Permalink
WIP: try to handle cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Dec 4, 2024
1 parent 8896570 commit 9f2a69e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ const slab = require('./slab')
const config = require('./config')
const core = require('@actions/core')
const { waitForRunnerRegistered } = require('./gh')
const utils = require('./utils')

function setOutput(label) {
core.setOutput('label', label)
}

process.on('SIGINT', function () {
core.info('CANCEL caught !!!')
process.exit()
})

async function start() {
const provider = config.input.backend

Expand All @@ -33,6 +39,9 @@ async function start() {
)}`
)

core.info('[DEBUG] About to wait 30 seconds for cancelation') // DEBUG
await utils.sleep(30) // DEBUG

try {
const wait_instance_response = await slab.waitForInstance(
start_instance_response.task_id,
Expand Down

0 comments on commit 9f2a69e

Please sign in to comment.