Skip to content

Commit

Permalink
Only track errored outcome in DB for asset resize
Browse files Browse the repository at this point in the history
  • Loading branch information
talal committed Mar 11, 2020
1 parent 7edd645 commit d7525f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions internal/tasks/asset_resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,15 @@ func (c Context) ExecuteNextResize() (targetAssetType db.AssetType, returnedErro
}
logg.Error(e.Error())

//do not log "failed" operations to Sentry: fixing them is not within the
//responsibility of the Castellum operator
if c.SentryHub != nil && outcome == db.OperationOutcomeErrored {
captureSentryException(c.SentryHub, e)
}
if outcome == db.OperationOutcomeErrored {
//do not log "failed" operations to Sentry: fixing them is not within the
//responsibility of the Castellum operator
if c.SentryHub != nil {
captureSentryException(c.SentryHub, e)
}

errorMessage = err.Error()
errorMessage = err.Error()
}
}

finishedOp := op.IntoFinishedOperation(outcome, c.TimeNow())
Expand Down
1 change: 0 additions & 1 deletion internal/tasks/asset_resize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func TestFailingResize(tBase *testing.T) {
GreenlitAt: p2time(c.TimeNow().Add(-5 * time.Minute)),
FinishedAt: c.TimeNow(),
Outcome: db.OperationOutcomeFailed,
ErrorMessage: "SetAssetSize failing as requested",
})

//check that asset does not have an ExpectedSize
Expand Down

0 comments on commit d7525f4

Please sign in to comment.