Skip to content

Commit

Permalink
chore(slab): fix task status handling
Browse files Browse the repository at this point in the history
  • Loading branch information
soonum committed Jul 10, 2024
1 parent 265c721 commit 2c3ecb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions dist/index.js

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

11 changes: 7 additions & 4 deletions src/slab.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@ async function waitForInstance(taskId, taskName) {

if (response.ok) {
const body = await response.json()
if (body[taskName].status.toLowerCase() === 'done') {
const task_status = body[taskName].status.toLowerCase()

if (task_status === 'done') {
await removeTask(taskId)
return body
} else if (body[taskName].status.toLowerCase() === 'failed') {
await removeTask(taskId)
} else if (task_status === 'failed') {
core.error(
`Instance task failed (details: ${body[taskName].status.details})`
`Instance task failed (details: ${body[taskName].details})`
)
core.setFailed('Failure occurred while waiting for instance.')
await removeTask(taskId)
return
}
} else {
core.error(
Expand Down

0 comments on commit 2c3ecb3

Please sign in to comment.