Skip to content

Commit

Permalink
Use getter function instead of dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
vancexu committed Jan 10, 2018
1 parent 7a51af2 commit 48e40e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions common/persistence/cassandraPersistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -1494,8 +1494,8 @@ func (d *cassandraPersistence) CreateTasks(request *CreateTasksRequest) (*Create
rowTypeTask,
task.TaskID,
domainID,
*task.Execution.WorkflowId,
*task.Execution.RunId,
task.Execution.GetWorkflowId(),
task.Execution.GetRunId(),
scheduleID)
} else {
batch.Query(templateCreateTaskWithTTLQuery,
Expand All @@ -1505,8 +1505,8 @@ func (d *cassandraPersistence) CreateTasks(request *CreateTasksRequest) (*Create
rowTypeTask,
task.TaskID,
domainID,
*task.Execution.WorkflowId,
*task.Execution.RunId,
task.Execution.GetWorkflowId(),
task.Execution.GetRunId(),
scheduleID,
task.Data.ScheduleToStartTimeout)
}
Expand Down
22 changes: 11 additions & 11 deletions service/matching/matchingEngine.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (e *matchingEngineImpl) removeTaskListManager(id *taskListID) {

// AddDecisionTask either delivers task directly to waiting poller or save it into task list persistence.
func (e *matchingEngineImpl) AddDecisionTask(addRequest *m.AddDecisionTaskRequest) error {
domainID := *addRequest.DomainUUID
domainID := addRequest.GetDomainUUID()
taskListName := *addRequest.TaskList.Name
e.logger.Debugf("Received AddDecisionTask for taskList=%v, WorkflowID=%v, RunID=%v, ScheduleToStartTimeout=%v",
addRequest.TaskList.GetName(), addRequest.Execution.GetWorkflowId(), addRequest.Execution.GetRunId(),
Expand All @@ -210,18 +210,18 @@ func (e *matchingEngineImpl) AddDecisionTask(addRequest *m.AddDecisionTaskReques
}
taskInfo := &persistence.TaskInfo{
DomainID: domainID,
RunID: *addRequest.Execution.RunId,
WorkflowID: *addRequest.Execution.WorkflowId,
ScheduleID: *addRequest.ScheduleId,
ScheduleToStartTimeout: *addRequest.ScheduleToStartTimeoutSeconds,
RunID: addRequest.Execution.GetRunId(),
WorkflowID: addRequest.Execution.GetWorkflowId(),
ScheduleID: addRequest.GetScheduleId(),
ScheduleToStartTimeout: addRequest.GetScheduleToStartTimeoutSeconds(),
}
return tlMgr.AddTask(addRequest.Execution, taskInfo)
}

// AddActivityTask either delivers task directly to waiting poller or save it into task list persistence.
func (e *matchingEngineImpl) AddActivityTask(addRequest *m.AddActivityTaskRequest) error {
domainID := *addRequest.DomainUUID
sourceDomainID := *addRequest.SourceDomainUUID
domainID := addRequest.GetDomainUUID()
sourceDomainID := addRequest.GetSourceDomainUUID()
taskListName := *addRequest.TaskList.Name
e.logger.Debugf("Received AddActivityTask for taskList=%v WorkflowID=%v, RunID=%v",
taskListName, addRequest.Execution.WorkflowId, addRequest.Execution.RunId)
Expand All @@ -232,10 +232,10 @@ func (e *matchingEngineImpl) AddActivityTask(addRequest *m.AddActivityTaskReques
}
taskInfo := &persistence.TaskInfo{
DomainID: sourceDomainID,
RunID: *addRequest.Execution.RunId,
WorkflowID: *addRequest.Execution.WorkflowId,
ScheduleID: *addRequest.ScheduleId,
ScheduleToStartTimeout: *addRequest.ScheduleToStartTimeoutSeconds,
RunID: addRequest.Execution.GetRunId(),
WorkflowID: addRequest.Execution.GetWorkflowId(),
ScheduleID: addRequest.GetScheduleId(),
ScheduleToStartTimeout: addRequest.GetScheduleToStartTimeoutSeconds(),
}
return tlMgr.AddTask(addRequest.Execution, taskInfo)
}
Expand Down

0 comments on commit 48e40e2

Please sign in to comment.