Store host name only instead of full domain name in the internal state
parent
a4f28bbc2b
commit
594e5333d6
|
@ -6,6 +6,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"strings"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
@ -317,6 +318,9 @@ func newInternalState(coin string, d *db.RocksDB) (*common.InternalState, error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Error("get hostname ", err)
|
glog.Error("get hostname ", err)
|
||||||
} else {
|
} else {
|
||||||
|
if i := strings.IndexByte(name, '.'); i > 0 {
|
||||||
|
name = name[:i]
|
||||||
|
}
|
||||||
is.Host = name
|
is.Host = name
|
||||||
}
|
}
|
||||||
return is, nil
|
return is, nil
|
||||||
|
|
Loading…
Reference in New Issue