Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Nov 28, 2023
1 parent 7ddf16b commit b509be4
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ services:
timeout: 5s
retries: 30
volumes:
- ./mirror-name-search.sh:/etc/temporal/entrypoint.sh
- ./scripts/mirror-name-search.sh:/etc/temporal/entrypoint.sh

temporal-ui:
container_name: temporal-ui
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ services:
timeout: 5s
retries: 30
volumes:
- ./mirror-name-search.sh:/etc/temporal/entrypoint.sh
- ./scripts/mirror-name-search.sh:/etc/temporal/entrypoint.sh

temporal-ui:
container_name: temporal-ui
Expand Down
6 changes: 3 additions & 3 deletions flow/cmd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (h *FlowRequestHandler) CreateCDCFlow(
ID: workflowID,
TaskQueue: h.peerflowTaskQueueID,
SearchAttributes: map[string]interface{}{
"MirrorName": cfg.FlowJobName,
shared.MirrorNameSearchAttribute: cfg.FlowJobName,
},
}

Expand Down Expand Up @@ -233,7 +233,7 @@ func (h *FlowRequestHandler) CreateQRepFlow(
ID: workflowID,
TaskQueue: h.peerflowTaskQueueID,
SearchAttributes: map[string]interface{}{
"MirrorName": cfg.FlowJobName,
shared.MirrorNameSearchAttribute: cfg.FlowJobName,
},
}
if req.CreateCatalogEntry {
Expand Down Expand Up @@ -318,7 +318,7 @@ func (h *FlowRequestHandler) ShutdownFlow(
ID: workflowID,
TaskQueue: h.peerflowTaskQueueID,
SearchAttributes: map[string]interface{}{
"MirrorName": req.FlowJobName,
shared.MirrorNameSearchAttribute: req.FlowJobName,
},
}
dropFlowHandle, err := h.temporalClient.ExecuteWorkflow(
Expand Down
2 changes: 2 additions & 0 deletions flow/shared/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const (
CDCFlowSignalName = "peer-flow-signal"
)

const MirrorNameSearchAttribute = "MirrorName"

type CDCFlowSignal int64
type ContextKey string

Expand Down
4 changes: 2 additions & 2 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func CDCFlowWorkflowWithConfig(
}

mirrorNameSearch := map[string]interface{}{
"MirrorName": cfg.FlowJobName,
shared.MirrorNameSearchAttribute: cfg.FlowJobName,
}

// start the SetupFlow workflow as a child workflow, and wait for it to complete
Expand Down Expand Up @@ -330,7 +330,7 @@ func CDCFlowWorkflowWithConfig(
}

mirrorNameSearch := map[string]interface{}{
"MirrorName": cfg.FlowJobName,
shared.MirrorNameSearchAttribute: cfg.FlowJobName,
}
// execute the sync flow as a child workflow
childSyncFlowOpts := workflow.ChildWorkflowOptions{
Expand Down
2 changes: 1 addition & 1 deletion flow/workflows/qrep_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func (q *QRepFlowExecution) startChildWorkflow(
MaximumAttempts: 20,
},
SearchAttributes: map[string]interface{}{
"MirrorName": q.config.FlowJobName,
shared.MirrorNameSearchAttribute: q.config.FlowJobName,
},
})

Expand Down
File renamed without changes.

0 comments on commit b509be4

Please sign in to comment.