diff options
| author | Jeff Carr <[email protected]> | 2025-10-07 10:14:25 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-07 10:14:25 -0500 |
| commit | bbe79b877e37445752f60f9ca491feac29b5cea1 (patch) | |
| tree | 714ad694f6b4e1dc65618efd36d2d8e102d1ce17 | |
| parent | fbc6477ec86c3968f983593ac1ce1825b33fea80 (diff) | |
move function back
| -rw-r--r-- | common.go | 11 | ||||
| -rw-r--r-- | http.go | 12 |
2 files changed, 12 insertions, 11 deletions
@@ -2,7 +2,11 @@ package zoopb -import "go.wit.com/lib/config" +import ( + "time" + + "go.wit.com/lib/config" +) var pbfile string = "/var/cache/zookeeper/machine" @@ -13,3 +17,8 @@ func (pb *Machine) Save() error { func (pb *Machine) Load() error { return config.LoadFile(pb, pbfile) } + +func (m *Machine) SinceLastUpdate() time.Duration { + age := m.Laststamp.AsTime() + return time.Since(age) +} @@ -2,16 +2,7 @@ package zoopb -import ( - "bytes" - "fmt" - "io/ioutil" - "net/http" - "os/user" - - "go.wit.com/log" -) - +/* func (m *Machine) HttpPostMachine(url string) ([]byte, error) { if m == nil { // run f.InitMachine() here? @@ -73,3 +64,4 @@ func (m *Machine) HttpPostOld(url string, data []byte) ([]byte, error) { return body, nil } +*/ |
