fix: Synchronously notify subscribers when writing Create events to CDK backend (#110476)

* Remove goroutine when writing events on CDK backend

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>

---------

Signed-off-by: Maicon Costa <maiconscosta@gmail.com>
This commit is contained in:
maicon
2025-09-03 11:49:04 -03:00
committed by GitHub
parent 9b18987df1
commit fa20755d4b
+10 -12
View File
@@ -146,19 +146,17 @@ func (s *cdkBackend) WriteEvent(ctx context.Context, event WriteEvent) (rv int64
}) })
} }
// Async notify all subscribers // notify all subscribers
if s.stream != nil { if s.stream != nil {
go func() { write := &WrittenEvent{
write := &WrittenEvent{ Type: event.Type,
Type: event.Type, Key: event.Key,
Key: event.Key, PreviousRV: event.PreviousRV,
PreviousRV: event.PreviousRV, Value: event.Value,
Value: event.Value, Timestamp: time.Now().UnixMilli(),
Timestamp: time.Now().UnixMilli(), ResourceVersion: rv,
ResourceVersion: rv, }
} s.stream <- write
s.stream <- write
}()
} }
return rv, err return rv, err
} }