HA: context used to start transaction must not be canceled before the transaction is committed

This was introduced by 621c1b9537 and leads to
tx.Commit() always returning an "context canceled" error.
This commit is contained in:
Julian Brost 2021-05-31 14:48:15 +02:00
parent 2a8fc05ddb
commit 31aed435cc

View file

@ -233,14 +233,15 @@ func (h *HA) realize(s *icingaredisv1.IcingaStatus, t *types.UnixMilli, shouldLo
}
}
cancel()
if err := tx.Commit(); err != nil {
cancel()
return err
}
if takeover {
h.signalTakeover()
}
cancel()
break
}