Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(slab): log details and waiting on the instance #43

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading