Skip to content

Commit 8438696

Browse files
committed
Fix AutoConfigHint population in the mapper
1 parent 72fd3b1 commit 8438696

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

internal/compatibility/proto/response.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ func PollForActivityTaskResponse(t *shared.PollForActivityTaskResponse) *apiv1.P
210210
WorkflowType: WorkflowType(t.WorkflowType),
211211
WorkflowDomain: t.GetWorkflowDomain(),
212212
Header: Header(t.Header),
213+
AutoConfigHint: AutoConfigHint(t.AutoConfigHint),
213214
}
214215
}
215216

@@ -234,6 +235,7 @@ func PollForDecisionTaskResponse(t *shared.PollForDecisionTaskResponse) *apiv1.P
234235
Queries: WorkflowQueryMap(t.Queries),
235236
NextEventId: t.GetNextEventId(),
236237
TotalHistoryBytes: t.GetTotalHistoryBytes(),
238+
AutoConfigHint: AutoConfigHint(t.AutoConfigHint),
237239
}
238240
}
239241

internal/compatibility/proto/types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ func ActivityType(t *shared.ActivityType) *apiv1.ActivityType {
7777
}
7878
}
7979

80+
func AutoConfigHint(t *shared.AutoConfigHint) *apiv1.AutoConfigHint {
81+
if t == nil {
82+
return nil
83+
}
84+
return &apiv1.AutoConfigHint{
85+
EnableAutoConfig: t.GetEnableAutoConfig(),
86+
PollerWaitTimeInMs: t.GetPollerWaitTimeInMs(),
87+
}
88+
}
89+
8090
func WorkflowType(t *shared.WorkflowType) *apiv1.WorkflowType {
8191
if t == nil {
8292
return nil

internal/compatibility/testdata/common.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ var (
208208
ActivityLocalDispatchInfoMap = map[string]*apiv1.ActivityLocalDispatchInfo{
209209
ActivityID: &ActivityLocalDispatchInfo,
210210
}
211+
AutoConfigHint = apiv1.AutoConfigHint{
212+
EnableAutoConfig: true,
213+
PollerWaitTimeInMs: 100,
214+
}
211215
TaskListMetadata = apiv1.TaskListMetadata{
212216
MaxTasksPerSecond: &gogo.DoubleValue{Value: RatePerSecond},
213217
}

internal/compatibility/testdata/service.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ var (
199199
StartedTime: Timestamp2,
200200
Queries: WorkflowQueryMap,
201201
NextEventId: EventID3,
202+
AutoConfigHint: &AutoConfigHint,
202203
}
203204
RespondDecisionTaskCompletedRequest = apiv1.RespondDecisionTaskCompletedRequest{
204205
TaskToken: TaskToken,
@@ -245,6 +246,7 @@ var (
245246
WorkflowType: &WorkflowType,
246247
WorkflowDomain: DomainName,
247248
Header: &Header,
249+
AutoConfigHint: &AutoConfigHint,
248250
}
249251
RespondActivityTaskCompletedRequest = apiv1.RespondActivityTaskCompletedRequest{
250252
TaskToken: TaskToken,

0 commit comments

Comments
 (0)