Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: send change events always #119

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pkg/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,18 +681,18 @@ func (sc *Syncer) Solve(ctx context.Context, parallelism int, dry bool, isJSONOu
// sync mode
// fire the request to Kong
result, err = sc.processor.Do(ctx, e.Kind, e.Op, e)
if err != nil {
// TODO https://github.com/Kong/go-database-reconciler/issues/22 this does not print, but is switched on
// sc.enableEntityActions because the existing behavior returns a result from the anon Run function.
// Refactoring should use only the channel and simplify the return, probably to just an error (all the other
// data will have been sent through the result channel).
if sc.enableEntityActions {
actionResult.Error = err
select {
case sc.resultChan <- actionResult:
case <-ctx.Done():
}
// TODO https://github.com/Kong/go-database-reconciler/issues/22 this does not print, but is switched on
// sc.enableEntityActions because the existing behavior returns a result from the anon Run function.
// Refactoring should use only the channel and simplify the return, probably to just an error (all the other
// data will have been sent through the result channel).
if sc.enableEntityActions {
actionResult.Error = err
select {
case sc.resultChan <- actionResult:
case <-ctx.Done():
}
}
if err != nil {
return nil, &crud.ActionError{
OperationType: e.Op,
Kind: e.Kind,
Expand Down
Loading