Skip to content

Commit

Permalink
chore(slab): log details and waiting on the instance
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Nov 28, 2024
1 parent 98f0788 commit 53c25b8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion dist/index.js

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

9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ function setOutput(label) {
}

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

const start_instance_response = await slab.startInstanceRequest()
core.info(
`${provider} instance details: ${JSON.stringify(
start_instance_response.details
)}`
)

const wait_instance_response = await slab.waitForInstance(
start_instance_response.task_id,
'start'
)

const provider = config.input.backend
const instance_id = wait_instance_response.start.instance_id
core.info(`${provider} instance started with ID: ${instance_id}`)

Expand Down
3 changes: 3 additions & 0 deletions src/slab.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ async function startInstanceRequest() {
}

async function waitForInstance(taskId, taskName) {
core.info(`Wait for instance to ${taskName} (task ID: ${taskId})`)

// while (true) equivalent to please ESLint
for (;;) {
await utils.sleep(15)

try {
core.info('Checking...')
const response = await getTask(taskId)

if (response.ok) {
Expand Down

0 comments on commit 53c25b8

Please sign in to comment.