Skip to content

Commit

Permalink
Fail synchronization in case of inconsistencies
Browse files Browse the repository at this point in the history
  • Loading branch information
zdevaty committed Apr 5, 2024
1 parent 83c1a67 commit a27b36f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ func collectResources(config apiserver.Configuration) error {
continue
}

if !booking.ExchangeChangeKey.Valid || booking.ExchangeChangeKey.String != a.ExchangeChangeKey {
if !booking.ExchangeChangeKey.Valid {
log.Error("conf", "undefined state: booking %v has no change key", booking.ExchangeID.String)
continue
}

if booking.ExchangeChangeKey.String != a.ExchangeChangeKey {
// Booking has changed.
changedBookings = append(changedBookings, a)
booking.ExchangeChangeKey = null.StringFrom(a.ExchangeChangeKey)
Expand Down

0 comments on commit a27b36f

Please sign in to comment.