builds again
This commit is contained in:
parent
fec35a8336
commit
3f5f386395
10
instance.go
10
instance.go
@ -28,6 +28,8 @@ type Instance struct {
|
|||||||
errorCount uint
|
errorCount uint
|
||||||
highestId int
|
highestId int
|
||||||
hostName string
|
hostName string
|
||||||
|
up bool
|
||||||
|
identified bool
|
||||||
impl ServerImplementation
|
impl ServerImplementation
|
||||||
lastError *time.Time
|
lastError *time.Time
|
||||||
lastSuccess *time.Time
|
lastSuccess *time.Time
|
||||||
@ -51,16 +53,14 @@ func NewInstance(hostname string) *Instance {
|
|||||||
func (i *Instance) setNextCheck(d *time.Duration) {
|
func (i *Instance) setNextCheck(d *time.Duration) {
|
||||||
i.Lock()
|
i.Lock()
|
||||||
defer i.Unlock()
|
defer i.Unlock()
|
||||||
i.nextCheck = d
|
then := time.Now().Add(*d)
|
||||||
|
i.nextCheck = &then
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Instance) dueForCheck() bool {
|
func (i *Instance) dueForCheck() bool {
|
||||||
i.Lock()
|
i.Lock()
|
||||||
defer i.Unlock()
|
defer i.Unlock()
|
||||||
if i.nextCheck <= time.Now() {
|
return i.nextCheck.Before(time.Now())
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Instance) detectNodeType() {
|
func (i *Instance) detectNodeType() {
|
||||||
|
Loading…
Reference in New Issue
Block a user