Skip to content

Commit

Permalink
Merge pull request #2307 from opengovern/fix-tasks
Browse files Browse the repository at this point in the history
fix: change params type in TaskDefinition
  • Loading branch information
artaasadi authored Dec 26, 2024
2 parents 12e5fdb + a1ddb26 commit ff4fea4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/lib/pq v1.10.9
github.com/nats-io/nats.go v1.36.0
github.com/open-policy-agent/opa v0.69.0
github.com/opengovern/og-util v1.7.1
github.com/opengovern/og-util v1.7.2
github.com/opensearch-project/opensearch-go/v2 v2.3.0
github.com/opensearch-project/opensearch-go/v4 v4.2.0
github.com/ory/dockertest/v3 v3.10.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,8 @@ github.com/opengovern/og-util v1.7.0 h1:2L3jXkasNLM+JO+vUmbmTCRf4ptjLvjDYqe/760C
github.com/opengovern/og-util v1.7.0/go.mod h1:ob8RSaNZG3RWnLH3lDXQaVpIf+B8Ry7ds3twYlDJPp0=
github.com/opengovern/og-util v1.7.1 h1:N2JgJWeMHGkfkGPgGd0Rr6w+Cjpbjc6+qfoidzjomFE=
github.com/opengovern/og-util v1.7.1/go.mod h1:ob8RSaNZG3RWnLH3lDXQaVpIf+B8Ry7ds3twYlDJPp0=
github.com/opengovern/og-util v1.7.2 h1:eLGgqSHQmYuSehRBXJcn61pD7uslCzZe9wbwJaEKbc0=
github.com/opengovern/og-util v1.7.2/go.mod h1:ob8RSaNZG3RWnLH3lDXQaVpIf+B8Ry7ds3twYlDJPp0=
github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ=
github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8=
github.com/opensearch-project/opensearch-go/v4 v4.2.0 h1:uaBexfVdeSU15yOUPYF+IY059koVP0oNQPyoSde6N/A=
Expand Down
4 changes: 2 additions & 2 deletions services/tasks/api/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ type TaskResponse struct {
}

type RunTaskRequest struct {
TaskID string `json:"task_id"`
Params map[string][]string `json:"params"`
TaskID string `json:"task_id"`
Params map[string]any `json:"params"`
}
4 changes: 2 additions & 2 deletions services/tasks/scheduler/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ func (s *TaskScheduler) runPublisher(ctx context.Context) error {
return nil
}

func JSONBToMap(jsonb pgtype.JSONB) (map[string][]string, error) {
func JSONBToMap(jsonb pgtype.JSONB) (map[string]any, error) {
if jsonb.Status != pgtype.Present {
return nil, fmt.Errorf("JSONB data is not present")
}

var result map[string][]string
var result map[string]any
if err := json.Unmarshal(jsonb.Bytes, &result); err != nil {
return nil, fmt.Errorf("failed to unmarshal JSONB: %w", err)
}
Expand Down

0 comments on commit ff4fea4

Please sign in to comment.