removeLocalStatus removes a replication status from the given metadataStore. This is done when a replication is reset.
(ctx context.Context, metadataStore base.DataStore, statusKey string)
| 571 | |
| 572 | // removeLocalStatus removes a replication status from the given metadataStore. This is done when a replication is reset. |
| 573 | func removeLocalStatus(ctx context.Context, metadataStore base.DataStore, statusKey string) (err error) { |
| 574 | base.TracefCtx(ctx, base.KeyReplicate, "removeLocalStatus() for %q", statusKey) |
| 575 | |
| 576 | // obtain current rev |
| 577 | currentStatus, err := getLocalStatusDoc(ctx, metadataStore, statusKey) |
| 578 | if err != nil { |
| 579 | base.WarnfCtx(ctx, "Unable to retrieve local status doc for %s, status not removed", statusKey) |
| 580 | return nil |
| 581 | } |
| 582 | if currentStatus == nil { |
| 583 | // nothing to do - status already doesn't exist |
| 584 | return nil |
| 585 | } |
| 586 | |
| 587 | _, _, err = putDocWithRevision(metadataStore, statusKey, currentStatus.Rev, nil, 0) |
| 588 | return err |
| 589 | } |
| 590 | |
| 591 | // registerFunctions must be called once after immediately after newActiveReplicatorCommon to set the functions that require a circular definition from parent (ActiveReplicatorPush/ActiveReplicatorPull) and activeReplicatorCommon. |
| 592 | func (arc *activeReplicatorCommon) registerFunctions(getStatusFn func() *ReplicationStatus, connectFn func() error, registerCheckpointerCallbacksFn func(*activeReplicatorCollection) error) { |
no test coverage detected