165
}
166
167
>
func PartitionFromProto(proto *taskqueuepb.TaskQueue, namespaceId string, taskType enumspb.TaskQueueType) (Partition, error) {
task_queue_id.go
168
>
baseName, partition, err := parseRpcName(proto.GetName())
169
>
if err != nil {
170
return nil, err
171
}
172
174
>
normalName := proto.GetNormalName()
175
>
if normalName != "" && kind != enumspb.TASK_QUEUE_KIND_STICKY {
176
return nil, serviceerror.NewInvalidArgumentf("only sticky queues can have normal name. tq: %s, normal name: %s", baseName, normalName)
177
}
178
181
>
if partition != 0 {
182
>
return nil, fmt.Errorf("%w. base name: %s, normal name: %s", ErrNonZeroSticky, baseName, normalName)
task_queue_id.go
183
>
}
185
>
return tq.StickyPartition(baseName), nil
186
case enumspb.TASK_QUEUE_KIND_WORKER_COMMANDS:
187
if partition != 0 {