Skip to content

Commit

Permalink
IWF-254: Remove default assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
lwolczynski committed Nov 13, 2024
1 parent 4fa6ed6 commit 1b34346
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
22 changes: 5 additions & 17 deletions service/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ func (s *serviceImpl) ApiV1WorkflowStartPost(
}
}

fmt.Print(workflowConfig)

if startOptions.GetUseMemoForDataAttributes() {
useMemoForDAs = true
workflowOptions.Memo[service.UseMemoForDataAttributesKey] = iwfidl.EncodedObject{
Expand Down Expand Up @@ -196,29 +194,19 @@ func (s *serviceImpl) ApiV1WorkflowStartPost(
}

func overrideWorkflowConfig(configOverride iwfidl.WorkflowConfig, workflowConfig *iwfidl.WorkflowConfig) {
if configOverride.ExecutingStateIdMode == nil {
workflowConfig.ExecutingStateIdMode = ptr.Any(service.DefaultExecutingStateIdMode)
} else {
if configOverride.ExecutingStateIdMode != nil {
workflowConfig.ExecutingStateIdMode = configOverride.ExecutingStateIdMode
}
if configOverride.ContinueAsNewThreshold == nil {
workflowConfig.ContinueAsNewThreshold = iwfidl.PtrInt32(service.DefaultContinueAsNewThreshold)
} else {
if configOverride.ContinueAsNewThreshold != nil {
workflowConfig.ContinueAsNewThreshold = configOverride.ContinueAsNewThreshold
}
if configOverride.ContinueAsNewPageSizeInBytes == nil {
workflowConfig.ContinueAsNewPageSizeInBytes = iwfidl.PtrInt32(service.DefaultContinueAsNewPageSizeInBytes)
} else {
if configOverride.ContinueAsNewPageSizeInBytes != nil {
workflowConfig.ContinueAsNewPageSizeInBytes = configOverride.ContinueAsNewPageSizeInBytes
}
if configOverride.DisableSystemSearchAttribute == nil {
workflowConfig.DisableSystemSearchAttribute = iwfidl.PtrBool(false)
} else {
if configOverride.DisableSystemSearchAttribute != nil {
workflowConfig.DisableSystemSearchAttribute = configOverride.DisableSystemSearchAttribute
}
if configOverride.OptimizeActivity == nil {
workflowConfig.OptimizeActivity = iwfidl.PtrBool(false)
} else {
if configOverride.OptimizeActivity != nil {
workflowConfig.OptimizeActivity = configOverride.OptimizeActivity
}
}
Expand Down
5 changes: 0 additions & 5 deletions service/const.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package service

import "github.com/indeedeng/iwf/gen/iwfidl"

type (
BackendType string
)

const (
EnvNameDebugMode = "DEBUG_MODE"

// Defaults for WorkflowConfig excluding booleans
DefaultContinueAsNewPageSizeInBytes = 1024 * 1024
DefaultContinueAsNewThreshold = 100
DefaultExecutingStateIdMode = iwfidl.ENABLED_FOR_STATES_WITH_WAIT_UNTIL

// below are special unofficial code for special use case

Expand Down

0 comments on commit 1b34346

Please sign in to comment.