Fix transaction rase.
if a long transaction didn't commited yet then another transactin may get hosts old information and commit it after the first transaction.
So it will overwrite all the new information with the old one
@@ -891,8 +891,7 @@ func (b *bareMetalInventory) GetNextSteps(ctx context.Context, params installer.
}
host.CheckedInAt = strfmt.DateTime(time.Now())
-
- if err := tx.Model(&host).Update(host).Error; err != nil {
+ if err := tx.Model(&host).Update("checked_in_at", host.CheckedInAt).Error; err != nil {
tx.Rollback()
log.WithError(err).Errorf("failed to update host: %s", params.ClusterID)
return installer.NewGetNextStepsInternalServerError()
