Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed May 31, 2022
1 parent 23873a2 commit fec541e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ func InitHostname() error {
name: hostname,
}

go loopUpdateHostname()
go Hostname.update()

return nil
}

func loopUpdateHostname() {
func (c *HostnameCache) update() {
for {
time.Sleep(time.Second)
name, err := os.Hostname()
Expand Down

0 comments on commit fec541e

Please sign in to comment.