From a27b36f05eb7afb678482508b4bb4cc66c0ba2b5 Mon Sep 17 00:00:00 2001 From: Zdenek Devaty Date: Fri, 5 Apr 2024 07:51:18 +0200 Subject: [PATCH] Fail synchronization in case of inconsistencies --- app.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index a9e0ee0..e2f90e0 100644 --- a/app.go +++ b/app.go @@ -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)