diff --git a/dist/index.js b/dist/index.js index 4abb551..1bde2fd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -51855,11 +51855,22 @@ const slab = __nccwpck_require__(4156) const config = __nccwpck_require__(4570) const core = __nccwpck_require__(2186) const { waitForRunnerRegistered } = __nccwpck_require__(6989) +const utils = __nccwpck_require__(1608) function setOutput(label) { core.setOutput('label', label) } +process.on('SIGINT', async function () { + core.info('CANCEL caught !!!') + core.info('[DEBUG] About to wait 2 seconds async in cleanup') + await utils.sleep(2) // DEBUG + core.info('[DEBUG] Sleep finished') + process.exit() +}) + +// TODO Write a cleanup function + async function start() { const provider = config.input.backend @@ -51886,6 +51897,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, diff --git a/src/index.js b/src/index.js index 57019a7..fcd84b0 100644 --- a/src/index.js +++ b/src/index.js @@ -2,11 +2,22 @@ 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', async function () { + core.info('CANCEL caught !!!') + core.info('[DEBUG] About to wait 2 seconds async in cleanup') + await utils.sleep(2) // DEBUG + core.info('[DEBUG] Sleep finished') + process.exit() +}) + +// TODO Write a cleanup function + async function start() { const provider = config.input.backend @@ -33,6 +44,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,