Skip to content

Commit

Permalink
Log transfer/ingest status polling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sevein committed Jun 26, 2023
1 parent 2498c38 commit 1625963
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/workflow/activities/poll_ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/cenkalti/backoff/v4"
cadencesdk_activity "go.uber.org/cadence/activity"
"go.uber.org/zap"

"github.com/artefactual-labs/enduro/internal/pipeline"
wferrors "github.com/artefactual-labs/enduro/internal/workflow/errors"
Expand All @@ -27,6 +28,8 @@ type PollIngestActivityParams struct {
}

func (a *PollIngestActivity) Execute(ctx context.Context, params *PollIngestActivityParams) (time.Time, error) {
logger := cadencesdk_activity.GetLogger(ctx)

p, err := a.manager.Pipelines.ByName(params.PipelineName)
if err != nil {
return time.Time{}, wferrors.NonRetryableError(err)
Expand Down Expand Up @@ -59,6 +62,10 @@ func (a *PollIngestActivity) Execute(ctx context.Context, params *PollIngestActi
return err
}

if err != nil {
logger.Error("Failed to look up Ingest status.", zap.Error(err))
}

// Retry unless the deadline was exceeded.
if lastRetryableError.IsZero() {
lastRetryableError = clock.Now()
Expand Down
7 changes: 7 additions & 0 deletions internal/workflow/activities/poll_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/cenkalti/backoff/v4"
cadencesdk_activity "go.uber.org/cadence/activity"
"go.uber.org/zap"

"github.com/artefactual-labs/enduro/internal/pipeline"
wferrors "github.com/artefactual-labs/enduro/internal/workflow/errors"
Expand All @@ -31,6 +32,8 @@ type PollTransferActivityParams struct {
}

func (a *PollTransferActivity) Execute(ctx context.Context, params *PollTransferActivityParams) (string, error) {
logger := cadencesdk_activity.GetLogger(ctx)

p, err := a.manager.Pipelines.ByName(params.PipelineName)
if err != nil {
return "", wferrors.NonRetryableError(err)
Expand Down Expand Up @@ -64,6 +67,10 @@ func (a *PollTransferActivity) Execute(ctx context.Context, params *PollTransfer
return err
}

if err != nil {
logger.Error("Failed to look up Transfer status.", zap.Error(err))
}

// Retry unless the deadline was exceeded.
if lastRetryableError.IsZero() {
lastRetryableError = clock.Now()
Expand Down

0 comments on commit 1625963

Please sign in to comment.