setState updates replicator state and resets lastError to nil. Expects callers to be holding activeReplicatorCommon.lock
(state string)
| 428 | // setState updates replicator state and resets lastError to nil. Expects callers |
| 429 | // to be holding activeReplicatorCommon.lock |
| 430 | func (arc *activeReplicatorCommon) setState(state string) { |
| 431 | arc.stateErrorLock.Lock() |
| 432 | arc.state = state |
| 433 | if state == ReplicationStateRunning { |
| 434 | arc.lastError = nil |
| 435 | } |
| 436 | arc.stateErrorLock.Unlock() |
| 437 | } |
| 438 | |
| 439 | func (arc *activeReplicatorCommon) getState() string { |
| 440 | arc.stateErrorLock.RLock() |