Skip to content

Commit

Permalink
Merge pull request #2290 from opengovern/fix-tasks
Browse files Browse the repository at this point in the history
fix: get multiple parameters in task
  • Loading branch information
artaasadi authored Dec 20, 2024
2 parents c150e4f + 79b0504 commit 62c324d
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.1.14-0.20241219130558-d70ee92c91fa
github.com/opengovern/og-util v1.2.1
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 @@ -999,6 +999,8 @@ github.com/opencontainers/runc v1.2.0 h1:qke7ZVCmJcKrJVY2iHJVC+0kql9uYdkusOPsQOO
github.com/opencontainers/runc v1.2.0/go.mod h1:/PXzF0h531HTMsYQnmxXkBD7YaGShm/2zcRB79dksUc=
github.com/opengovern/og-util v1.1.14-0.20241219130558-d70ee92c91fa h1:srcr2aeDLSN+t2BhuB9JvWTUDhvBx1DVqXhEXasSSV4=
github.com/opengovern/og-util v1.1.14-0.20241219130558-d70ee92c91fa/go.mod h1:Q7Pd/1SzDtYoF3iAd4/FSBmFihis+7OIeDpU94xawXQ=
github.com/opengovern/og-util v1.2.1 h1:jTYMnJ4au3b9YsLbkmsYvFORrCeUlG79KGH66b8XWWI=
github.com/opengovern/og-util v1.2.1/go.mod h1:Q7Pd/1SzDtYoF3iAd4/FSBmFihis+7OIeDpU94xawXQ=
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][]string `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][]string, error) {
if jsonb.Status != pgtype.Present {
return nil, fmt.Errorf("JSONB data is not present")
}

var result map[string]string
var result map[string][]string
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 62c324d

Please sign in to comment.