From 6427273165c294156f180169d9a94cfc783634c2 Mon Sep 17 00:00:00 2001 From: JungJun Date: Wed, 17 Aug 2022 14:33:04 +0900 Subject: [PATCH] =?UTF-8?q?hosname=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- icsstat/icsstat.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/icsstat/icsstat.go b/icsstat/icsstat.go index 956391f..60fa1a0 100644 --- a/icsstat/icsstat.go +++ b/icsstat/icsstat.go @@ -5,6 +5,7 @@ import ( "fmt" "io" "math/rand" + "os" "strings" "sync" "time" @@ -146,7 +147,7 @@ func ListenStatMNG1() (icserr *icserror.IcsError) { } func NewSidVal() { - conf := icsconf.GetIcsConfig() + // conf := icsconf.GetIcsConfig() timeN := time.Now() nano := fmt.Sprintf("%d", timeN.UTC().Nanosecond()) seq := fmt.Sprintf("%02d%02d%02d%03s", timeN.Hour(), timeN.Minute(), timeN.Second(), nano[:3]) @@ -155,8 +156,14 @@ func NewSidVal() { } gSeqVal.M = &sync.Mutex{} + hostname, err := os.Hostname() + if err != nil { + fmt.Println(err) + os.Exit(1) + } + ghost = &Host{ - HostName: conf.InfoConfig.HostName, + HostName: hostname, } ghost.M = &sync.Mutex{} }