Skip to content

Commit

Permalink
exiting 0 when activity error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
kafkasl committed Oct 29, 2021
1 parent 609ea78 commit c3581c4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pipeline-runner/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,15 @@ init <- function() {
message("Waiting for tasks")

repeat {
c(taskToken, input) %<-% states$get_activity_task(
activityArn = pipeline_config$activity_arn,
workerName = pipeline_config$pod_name
)
tryCatch( {
c(taskToken, input) %<-% states$get_activity_task(
activityArn = pipeline_config$activity_arn,
workerName = pipeline_config$pod_name
)
}, error = function(e) {
message("Error trying to get activity, exiting peacefully")
quit('no', 0)
})

if(is.null(taskToken) || !length(taskToken) || taskToken == "") {
message('No input received during last poll, shutting down...')
Expand Down

0 comments on commit c3581c4

Please sign in to comment.