Skip to content

Commit

Permalink
Merge pull request #2305 from opengovern/fix-tasks
Browse files Browse the repository at this point in the history
fix: update trigger job log
  • Loading branch information
artaasadi authored Dec 26, 2024
2 parents cab81c3 + 5436642 commit 3abcdd9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion services/describe/scheduler_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ func newDescribeConnectionJob(a integrationapi.Integration, resourceType string,

func (s *Scheduler) enqueueCloudNativeDescribeJob(ctx context.Context, dc model.DescribeIntegrationJob, cipherText string,
integration *integrationapi.Integration) error {
var err error

ctx, span := otel.Tracer(opengovernanceTrace.JaegerTracerName).Start(ctx, opengovernanceTrace.GetCurrentFuncName())
defer span.End()

Expand Down Expand Up @@ -443,7 +445,11 @@ func (s *Scheduler) enqueueCloudNativeDescribeJob(ctx context.Context, dc model.
isFailed := false
defer func() {
if isFailed {
err := s.db.UpdateDescribeIntegrationJobStatus(dc.ID, apiDescribe.DescribeResourceJobFailed, "Failed to invoke lambda", "Failed to invoke lambda", 0, 0)
var errMsg string
if err != nil {
errMsg = err.Error()
}
err := s.db.UpdateDescribeIntegrationJobStatus(dc.ID, apiDescribe.DescribeResourceJobFailed, errMsg, "Failed to send job through nats", 0, 0)
if err != nil {
s.logger.Error("failed to update describe resource job status",
zap.Uint("jobID", dc.ID),
Expand Down

0 comments on commit 3abcdd9

Please sign in to comment.