GetReadOnlyState returns the read-only state and timestamp of last read-only state update.
()
| 161 | |
| 162 | // GetReadOnlyState returns the read-only state and timestamp of last read-only state update. |
| 163 | func (i *InstanceDesc) GetReadOnlyState() (bool, time.Time) { |
| 164 | if i == nil { |
| 165 | return false, time.Time{} |
| 166 | } |
| 167 | |
| 168 | ts := time.Time{} |
| 169 | if i.ReadOnlyUpdatedTimestamp > 0 { |
| 170 | ts = time.Unix(i.ReadOnlyUpdatedTimestamp, 0) |
| 171 | } |
| 172 | |
| 173 | return i.ReadOnly, ts |
| 174 | } |
| 175 | |
| 176 | func (i *InstanceDesc) IsHealthy(op Operation, heartbeatTimeout time.Duration, now time.Time) bool { |
| 177 | healthy := op.IsInstanceInStateHealthy(i.State) |
no outgoing calls