Skip to content

Commit 9e9d1d7

Browse files
committed
Close queue before waiting for in-progress tasks
1 parent 0ef39ff commit 9e9d1d7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

internal/worker/activity.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ func (aw *activityWorker) Start(ctx context.Context) error {
5858
}
5959

6060
func (aw *activityWorker) WaitForCompletion() error {
61+
close(aw.activityTaskQueue)
62+
6163
aw.wg.Wait()
6264

6365
return nil

internal/worker/workflow.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func (ww *workflowWorker) Start(ctx context.Context) error {
7272
}
7373

7474
func (ww *workflowWorker) WaitForCompletion() error {
75+
close(ww.workflowTaskQueue)
76+
7577
ww.wg.Wait()
7678

7779
return nil

0 commit comments

Comments
 (0)