Skip to content

Commit e0ef03b

Browse files
committed
change function name and run fmt
1 parent a038fb0 commit e0ef03b

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

dbos/workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ func WithHandleTimeout(timeout time.Duration) GetResultOption {
120120
}
121121
}
122122

123-
// WithPollingInterval sets the polling interval for awaiting workflow completion in GetResult.
123+
// WithHandlePollingInterval sets the polling interval for awaiting workflow completion in GetResult.
124124
// If a non-positive interval is provided, the default interval is used.
125-
func WithPollingInterval(interval time.Duration) GetResultOption {
125+
func WithHandlePollingInterval(interval time.Duration) GetResultOption {
126126
return func(opts *getResultOptions) {
127127
if interval > 0 {
128128
opts.pollInterval = interval

dbos/workflows_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4544,20 +4544,20 @@ func TestWorkflowIdentity(t *testing.T) {
45444544
}
45454545

45464546
func TestWorkflowHandles(t *testing.T) {
4547-
dbosCtx := setupDBOS(t, true, true)
4548-
RegisterWorkflow(dbosCtx, slowWorkflow)
4547+
dbosCtx := setupDBOS(t, true, true)
4548+
RegisterWorkflow(dbosCtx, slowWorkflow)
45494549

4550-
t.Run("WorkflowHandleTimeout", func(t *testing.T) {
4551-
handle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
4552-
require.NoError(t, err, "failed to start workflow")
4550+
t.Run("WorkflowHandleTimeout", func(t *testing.T) {
4551+
handle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
4552+
require.NoError(t, err, "failed to start workflow")
45534553

4554-
start := time.Now()
4555-
_, err = handle.GetResult(WithHandleTimeout(10*time.Millisecond), WithPollingInterval(1*time.Millisecond))
4556-
duration := time.Since(start)
4554+
start := time.Now()
4555+
_, err = handle.GetResult(WithHandleTimeout(10*time.Millisecond), WithHandlePollingInterval(1*time.Millisecond))
4556+
duration := time.Since(start)
45574557

4558-
require.Error(t, err, "expected timeout error")
4559-
assert.Contains(t, err.Error(), "workflow result timeout")
4560-
assert.True(t, duration < 100*time.Millisecond, "timeout should occur quickly")
4558+
require.Error(t, err, "expected timeout error")
4559+
assert.Contains(t, err.Error(), "workflow result timeout")
4560+
assert.True(t, duration < 100*time.Millisecond, "timeout should occur quickly")
45614561
assert.True(t, errors.Is(err, context.DeadlineExceeded),
45624562
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
45634563
})
@@ -4567,18 +4567,18 @@ assert.True(t, duration < 100*time.Millisecond, "timeout should occur quickly")
45674567
originalHandle, err := RunWorkflow(dbosCtx, slowWorkflow, 10*time.Second)
45684568
require.NoError(t, err, "failed to start workflow")
45694569

4570-
pollingHandle, err := RetrieveWorkflow[string](dbosCtx, originalHandle.GetWorkflowID())
4571-
require.NoError(t, err, "failed to retrieve workflow")
4570+
pollingHandle, err := RetrieveWorkflow[string](dbosCtx, originalHandle.GetWorkflowID())
4571+
require.NoError(t, err, "failed to retrieve workflow")
45724572

4573-
_, ok := pollingHandle.(*workflowPollingHandle[string])
4574-
require.True(t, ok, "expected polling handle, got %T", pollingHandle)
4573+
_, ok := pollingHandle.(*workflowPollingHandle[string])
4574+
require.True(t, ok, "expected polling handle, got %T", pollingHandle)
45754575

4576-
_, err = pollingHandle.GetResult(WithHandleTimeout(10*time.Millisecond), WithPollingInterval(1*time.Millisecond))
4576+
_, err = pollingHandle.GetResult(WithHandleTimeout(10*time.Millisecond), WithHandlePollingInterval(1*time.Millisecond))
45774577

4578-
require.Error(t, err, "expected timeout error")
4579-
assert.True(t, errors.Is(err, context.DeadlineExceeded),
4580-
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
4581-
})
4578+
require.Error(t, err, "expected timeout error")
4579+
assert.True(t, errors.Is(err, context.DeadlineExceeded),
4580+
"expected error to be detectable as context.DeadlineExceeded, got: %v", err)
4581+
})
45824582
}
45834583

45844584
func TestWorkflowHandleContextCancel(t *testing.T) {

0 commit comments

Comments
 (0)