Skip to content

Commit 3effa87

Browse files
authored
add start delay (#78)
1 parent 424afc8 commit 3effa87

File tree

10 files changed

+131
-59
lines changed

10 files changed

+131
-59
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

gen/iwfidl/api/openapi.yaml

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ components:
438438
valueType: null
439439
integerValue: 1
440440
boolValue: true
441-
doubleValue: 1.0246457001441578
441+
doubleValue: 1.4894159098541704
442442
stringArrayValue:
443443
- stringArrayValue
444444
- stringArrayValue
@@ -485,10 +485,10 @@ components:
485485
type: object
486486
WorkflowRetryPolicy:
487487
example:
488-
maximumAttempts: 7
489-
initialIntervalSeconds: 3
490-
maximumIntervalSeconds: 4
491-
backoffCoefficient: 2.027123
488+
maximumAttempts: 1
489+
initialIntervalSeconds: 2
490+
maximumIntervalSeconds: 7
491+
backoffCoefficient: 4.145608
492492
properties:
493493
initialIntervalSeconds:
494494
type: integer
@@ -573,22 +573,23 @@ components:
573573
type: object
574574
WorkflowStartOptions:
575575
example:
576+
workflowStartDelaySeconds: 3
576577
retryPolicy:
577-
maximumAttempts: 7
578-
initialIntervalSeconds: 3
579-
maximumIntervalSeconds: 4
580-
backoffCoefficient: 2.027123
578+
maximumAttempts: 1
579+
initialIntervalSeconds: 2
580+
maximumIntervalSeconds: 7
581+
backoffCoefficient: 4.145608
581582
workflowConfigOverride:
582583
disableSystemSearchAttribute: true
583-
continueAsNewThreshold: 1
584-
continueAsNewPageSizeInBytes: 6
584+
continueAsNewThreshold: 6
585+
continueAsNewPageSizeInBytes: 7
585586
idReusePolicy: null
586587
searchAttributes:
587588
- stringValue: stringValue
588589
valueType: null
589590
integerValue: 1
590591
boolValue: true
591-
doubleValue: 1.0246457001441578
592+
doubleValue: 1.4894159098541704
592593
stringArrayValue:
593594
- stringArrayValue
594595
- stringArrayValue
@@ -597,7 +598,7 @@ components:
597598
valueType: null
598599
integerValue: 1
599600
boolValue: true
600-
doubleValue: 1.0246457001441578
601+
doubleValue: 1.4894159098541704
601602
stringArrayValue:
602603
- stringArrayValue
603604
- stringArrayValue
@@ -609,6 +610,9 @@ components:
609610
$ref: '#/components/schemas/IDReusePolicy'
610611
cronSchedule:
611612
type: string
613+
workflowStartDelaySeconds:
614+
format: int32
615+
type: integer
612616
retryPolicy:
613617
$ref: '#/components/schemas/WorkflowRetryPolicy'
614618
searchAttributes:
@@ -741,22 +745,23 @@ components:
741745
persistenceLoadingType: null
742746
iwfWorkflowType: iwfWorkflowType
743747
workflowStartOptions:
748+
workflowStartDelaySeconds: 3
744749
retryPolicy:
745-
maximumAttempts: 7
746-
initialIntervalSeconds: 3
747-
maximumIntervalSeconds: 4
748-
backoffCoefficient: 2.027123
750+
maximumAttempts: 1
751+
initialIntervalSeconds: 2
752+
maximumIntervalSeconds: 7
753+
backoffCoefficient: 4.145608
749754
workflowConfigOverride:
750755
disableSystemSearchAttribute: true
751-
continueAsNewThreshold: 1
752-
continueAsNewPageSizeInBytes: 6
756+
continueAsNewThreshold: 6
757+
continueAsNewPageSizeInBytes: 7
753758
idReusePolicy: null
754759
searchAttributes:
755760
- stringValue: stringValue
756761
valueType: null
757762
integerValue: 1
758763
boolValue: true
759-
doubleValue: 1.0246457001441578
764+
doubleValue: 1.4894159098541704
760765
stringArrayValue:
761766
- stringArrayValue
762767
- stringArrayValue
@@ -765,7 +770,7 @@ components:
765770
valueType: null
766771
integerValue: 1
767772
boolValue: true
768-
doubleValue: 1.0246457001441578
773+
doubleValue: 1.4894159098541704
769774
stringArrayValue:
770775
- stringArrayValue
771776
- stringArrayValue
@@ -923,7 +928,7 @@ components:
923928
valueType: null
924929
integerValue: 1
925930
boolValue: true
926-
doubleValue: 1.0246457001441578
931+
doubleValue: 1.4894159098541704
927932
stringArrayValue:
928933
- stringArrayValue
929934
- stringArrayValue
@@ -932,7 +937,7 @@ components:
932937
valueType: null
933938
integerValue: 1
934939
boolValue: true
935-
doubleValue: 1.0246457001441578
940+
doubleValue: 1.4894159098541704
936941
stringArrayValue:
937942
- stringArrayValue
938943
- stringArrayValue
@@ -1249,7 +1254,7 @@ components:
12491254
valueType: null
12501255
integerValue: 1
12511256
boolValue: true
1252-
doubleValue: 1.0246457001441578
1257+
doubleValue: 1.4894159098541704
12531258
stringArrayValue:
12541259
- stringArrayValue
12551260
- stringArrayValue
@@ -1258,7 +1263,7 @@ components:
12581263
valueType: null
12591264
integerValue: 1
12601265
boolValue: true
1261-
doubleValue: 1.0246457001441578
1266+
doubleValue: 1.4894159098541704
12621267
stringArrayValue:
12631268
- stringArrayValue
12641269
- stringArrayValue
@@ -1305,7 +1310,7 @@ components:
13051310
valueType: null
13061311
integerValue: 1
13071312
boolValue: true
1308-
doubleValue: 1.0246457001441578
1313+
doubleValue: 1.4894159098541704
13091314
stringArrayValue:
13101315
- stringArrayValue
13111316
- stringArrayValue
@@ -1314,7 +1319,7 @@ components:
13141319
valueType: null
13151320
integerValue: 1
13161321
boolValue: true
1317-
doubleValue: 1.0246457001441578
1322+
doubleValue: 1.4894159098541704
13181323
stringArrayValue:
13191324
- stringArrayValue
13201325
- stringArrayValue
@@ -1494,7 +1499,7 @@ components:
14941499
valueType: null
14951500
integerValue: 1
14961501
boolValue: true
1497-
doubleValue: 1.0246457001441578
1502+
doubleValue: 1.4894159098541704
14981503
stringArrayValue:
14991504
- stringArrayValue
15001505
- stringArrayValue
@@ -1503,7 +1508,7 @@ components:
15031508
valueType: null
15041509
integerValue: 1
15051510
boolValue: true
1506-
doubleValue: 1.0246457001441578
1511+
doubleValue: 1.4894159098541704
15071512
stringArrayValue:
15081513
- stringArrayValue
15091514
- stringArrayValue
@@ -1559,8 +1564,8 @@ components:
15591564
example:
15601565
workflowConfig:
15611566
disableSystemSearchAttribute: true
1562-
continueAsNewThreshold: 1
1563-
continueAsNewPageSizeInBytes: 6
1567+
continueAsNewThreshold: 6
1568+
continueAsNewPageSizeInBytes: 7
15641569
workflowRunId: workflowRunId
15651570
workflowId: workflowId
15661571
properties:
@@ -1581,7 +1586,7 @@ components:
15811586
valueType: null
15821587
integerValue: 1
15831588
boolValue: true
1584-
doubleValue: 1.0246457001441578
1589+
doubleValue: 1.4894159098541704
15851590
stringArrayValue:
15861591
- stringArrayValue
15871592
- stringArrayValue
@@ -1590,7 +1595,7 @@ components:
15901595
valueType: null
15911596
integerValue: 1
15921597
boolValue: true
1593-
doubleValue: 1.0246457001441578
1598+
doubleValue: 1.4894159098541704
15941599
stringArrayValue:
15951600
- stringArrayValue
15961601
- stringArrayValue
@@ -1737,7 +1742,7 @@ components:
17371742
valueType: null
17381743
integerValue: 1
17391744
boolValue: true
1740-
doubleValue: 1.0246457001441578
1745+
doubleValue: 1.4894159098541704
17411746
stringArrayValue:
17421747
- stringArrayValue
17431748
- stringArrayValue
@@ -1746,7 +1751,7 @@ components:
17461751
valueType: null
17471752
integerValue: 1
17481753
boolValue: true
1749-
doubleValue: 1.0246457001441578
1754+
doubleValue: 1.4894159098541704
17501755
stringArrayValue:
17511756
- stringArrayValue
17521757
- stringArrayValue
@@ -1798,7 +1803,7 @@ components:
17981803
valueType: null
17991804
integerValue: 1
18001805
boolValue: true
1801-
doubleValue: 1.0246457001441578
1806+
doubleValue: 1.4894159098541704
18021807
stringArrayValue:
18031808
- stringArrayValue
18041809
- stringArrayValue
@@ -1807,7 +1812,7 @@ components:
18071812
valueType: null
18081813
integerValue: 1
18091814
boolValue: true
1810-
doubleValue: 1.0246457001441578
1815+
doubleValue: 1.4894159098541704
18111816
stringArrayValue:
18121817
- stringArrayValue
18131818
- stringArrayValue
@@ -2396,8 +2401,8 @@ components:
23962401
WorkflowConfig:
23972402
example:
23982403
disableSystemSearchAttribute: true
2399-
continueAsNewThreshold: 1
2400-
continueAsNewPageSizeInBytes: 6
2404+
continueAsNewThreshold: 6
2405+
continueAsNewPageSizeInBytes: 7
24012406
properties:
24022407
disableSystemSearchAttribute:
24032408
type: boolean

gen/iwfidl/docs/WorkflowStartOptions.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**IdReusePolicy** | Pointer to [**IDReusePolicy**](IDReusePolicy.md) | | [optional]
88
**CronSchedule** | Pointer to **string** | | [optional]
9+
**WorkflowStartDelaySeconds** | Pointer to **int32** | | [optional]
910
**RetryPolicy** | Pointer to [**WorkflowRetryPolicy**](WorkflowRetryPolicy.md) | | [optional]
1011
**SearchAttributes** | Pointer to [**[]SearchAttribute**](SearchAttribute.md) | | [optional]
1112
**WorkflowConfigOverride** | Pointer to [**WorkflowConfig**](WorkflowConfig.md) | | [optional]
@@ -80,6 +81,31 @@ SetCronSchedule sets CronSchedule field to given value.
8081

8182
HasCronSchedule returns a boolean if a field has been set.
8283

84+
### GetWorkflowStartDelaySeconds
85+
86+
`func (o *WorkflowStartOptions) GetWorkflowStartDelaySeconds() int32`
87+
88+
GetWorkflowStartDelaySeconds returns the WorkflowStartDelaySeconds field if non-nil, zero value otherwise.
89+
90+
### GetWorkflowStartDelaySecondsOk
91+
92+
`func (o *WorkflowStartOptions) GetWorkflowStartDelaySecondsOk() (*int32, bool)`
93+
94+
GetWorkflowStartDelaySecondsOk returns a tuple with the WorkflowStartDelaySeconds field if it's non-nil, zero value otherwise
95+
and a boolean to check if the value has been set.
96+
97+
### SetWorkflowStartDelaySeconds
98+
99+
`func (o *WorkflowStartOptions) SetWorkflowStartDelaySeconds(v int32)`
100+
101+
SetWorkflowStartDelaySeconds sets WorkflowStartDelaySeconds field to given value.
102+
103+
### HasWorkflowStartDelaySeconds
104+
105+
`func (o *WorkflowStartOptions) HasWorkflowStartDelaySeconds() bool`
106+
107+
HasWorkflowStartDelaySeconds returns a boolean if a field has been set.
108+
83109
### GetRetryPolicy
84110

85111
`func (o *WorkflowStartOptions) GetRetryPolicy() WorkflowRetryPolicy`

gen/iwfidl/model_workflow_start_options.go

Lines changed: 42 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integ/workflow_uncompleted_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestStateApiTimeoutWorkflow(t *testing.T) {
112112

113113
fmt.Println(err)
114114

115-
expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error (type: StateApiWaitUntil, scheduledEventID: 9, startedEventID: 10, identity: ): activity StartToClose timeout (type: StartToClose)"
115+
expectedMsg := "workflow is not completed successfully, closedStatus: FAILED, failedErrorType(applies if failed as closedStatus):STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE, error message:activity error (type: StateApiWaitUntil, scheduledEventID: 8, startedEventID: 9, identity: ): activity StartToClose timeout (type: StartToClose)"
116116
assert.Equal(t, expectedMsg, err.Error())
117117

118118
out, err2 := client.GetComplexWorkflowResults(context.Background(), wfId, "")

iwf-idl

iwf/client_impl.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ func (c *clientImpl) StartWorkflow(ctx context.Context, workflow ObjectWorkflow,
3737
unregOpt.WorkflowIdReusePolicy = options.WorkflowIdReusePolicy
3838
unregOpt.WorkflowRetryPolicy = options.WorkflowRetryPolicy
3939
unregOpt.WorkflowCronSchedule = options.WorkflowCronSchedule
40+
unregOpt.WorkflowStartDelaySeconds = options.WorkflowStartDelaySeconds
4041

4142
saTypes := c.registry.getSearchAttributeTypeStore(wfType)
4243

0 commit comments

Comments
 (0)