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:
@@ -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 {
|
||||
go func() {
|
||||
write := &WrittenEvent{
|
||||
Type: event.Type,
|
||||
Key: event.Key,
|
||||
PreviousRV: event.PreviousRV,
|
||||
Value: event.Value,
|
||||
Timestamp: time.Now().UnixMilli(),
|
||||
ResourceVersion: rv,
|
||||
}
|
||||
s.stream <- write
|
||||
}()
|
||||
write := &WrittenEvent{
|
||||
Type: event.Type,
|
||||
Key: event.Key,
|
||||
PreviousRV: event.PreviousRV,
|
||||
Value: event.Value,
|
||||
Timestamp: time.Now().UnixMilli(),
|
||||
ResourceVersion: rv,
|
||||
}
|
||||
s.stream <- write
|
||||
}
|
||||
return rv, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user