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 {
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user