Fix statement and constructor

This commit is contained in:
Jean Flach 2019-03-22 13:59:59 +01:00 committed by Noah Hilverling
parent 80e1726cdf
commit cccb5cfeac

6
ha.go
View file

@ -22,7 +22,7 @@ type HA struct {
notificationListeners []chan int
}
func newHA(super *supervisor.Supervisor) (*HA, error) {
func NewHA(super *supervisor.Supervisor) (*HA, error) {
var err error
ho := HA{
super: super,
@ -51,8 +51,8 @@ func (h *HA) updateInstance() error {
func (h *HA) insertInstance() error {
_, err := h.super.Dbw.SqlExec("insert into icingadb_instance",
fmt.Sprintf("INSERT INTO icingadb_instance(id, environment_id, heartbeat, responsible) VALUES (%s, %s, %d, 'y')",
h.uid, h.super.EnvId, h.icinga2MTime))
fmt.Sprintf("INSERT INTO icingadb_instance(id, environment_id, heartbeat, responsible) VALUES ('%s', '%s', %d, 'y')",
h.uid[:], h.super.EnvId, h.icinga2MTime))
return err
}