Skip to content

Commit

Permalink
revert changes to getting job id from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
alishakawaguchi committed Dec 1, 2023
1 parent 79ce16a commit 00f6151
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/internal/dtomaps/job-runs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dtomaps

import (
"fmt"
"log/slog"

mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
Expand Down Expand Up @@ -39,7 +40,12 @@ func ToJobRunDto(

func GetJobIdFromWorkflow(logger *slog.Logger, searchAttributes *common.SearchAttributes) string {
scheduledByIDPayload := searchAttributes.IndexedFields["TemporalScheduledById"]
return converter.GetDefaultDataConverter().ToString(scheduledByIDPayload)
var scheduledByID string
err := converter.GetDefaultDataConverter().FromPayload(scheduledByIDPayload, &scheduledByID)
if err != nil {
logger.Error(fmt.Errorf("unable to get job id from workflow: %w", err).Error())
}
return scheduledByID
}

func ToJobRunEventTaskDto(event *history.HistoryEvent, taskError *mgmtv1alpha1.JobRunEventTaskError) *mgmtv1alpha1.JobRunEventTask {
Expand Down

0 comments on commit 00f6151

Please sign in to comment.