From cccb5cfeac35e069c90aa41d65d5c6c02f0fbf23 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Fri, 22 Mar 2019 13:59:59 +0100 Subject: [PATCH] Fix statement and constructor --- ha.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ha.go b/ha.go index 29dc3ba1..3ba95307 100644 --- a/ha.go +++ b/ha.go @@ -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 }