Skip to content

Commit 6ced0d1

Browse files
committed
fix
1 parent ef0e538 commit 6ced0d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dbos/system_database.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,10 +1158,10 @@ func (s *systemDatabase) Recv(ctx context.Context, input WorkflowRecvInput) (any
11581158
if !exists {
11591159
// We'll do so through registering a channel with the notification listener loop.
11601160
payload := fmt.Sprintf("%s::%s", destinationID, topic)
1161-
c := make(chan bool)
1161+
c := make(chan bool, 1) // Make it buffered to allow the notification listener to post a signal even if the receiver has not reached its select statement yet
11621162
_, loaded := s.notificationsMap.LoadOrStore(payload, c)
11631163
if loaded {
1164-
close(c) // Clean up the unused channel
1164+
close(c)
11651165
fmt.Println("Receive already called for workflow ", destinationID)
11661166
return nil, NewWorkflowConflictIDError(destinationID)
11671167
}

0 commit comments

Comments
 (0)