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 da9b7f9
Show file tree
Hide file tree
Showing 3 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.

6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ function setOutput(label) {

async function start() {
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'
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 da9b7f9

Please sign in to comment.