This commit is contained in:
Christian Schwarz
2021-04-16 10:10:16 +02:00
parent f28676b8d7
commit 5976264bce
3 changed files with 140 additions and 13 deletions
+14 -5
View File
@@ -58,7 +58,7 @@ const (
ActiveSideDone // also errors
)
type activeSideTasks struct {
type activeSideReplicationAndTriggerRemotePruneSequence struct {
state ActiveSideState
// valid for state ActiveSideReplicating, ActiveSidePruneSender, ActiveSidePruneReceiver, ActiveSideDone
@@ -67,10 +67,8 @@ type activeSideTasks struct {
replicationDone *report.Report
// valid for state ActiveSidePruneSender, ActiveSidePruneReceiver, ActiveSideDone
prunerSender, prunerReceiver *pruner.Pruner
// valid for state ActiveSidePruneReceiver, ActiveSideDone
prunerSenderCancel, prunerReceiverCancel context.CancelFunc
pruneRemote *pruner.Pruner
pruneRemoteCancel context.CancelFunc
}
func (a *ActiveSide) updateTasks(u func(*activeSideTasks)) activeSideTasks {
@@ -427,6 +425,13 @@ func (j *ActiveSide) Run(ctx context.Context) {
defer log.Info("job exiting")
type Activity interface {
Trigger() (interface{}, error)
}
var periodicActivity Activity
var replicationActivity Activity
periodicDone := make(chan struct{})
ctx, cancel := context.WithCancel(ctx)
defer cancel()
@@ -610,6 +615,10 @@ func (j *ActiveSide) Trigger(req ActiveSideTriggerRequest) (*ActiveSideSignalRes
return &ActiveSideSignalResponse{InvocationId: invocationId}, nil
}
type ReplicationPlusRemotePruneSequence struct {
}
func (j *ActiveSide) do(ctx context.Context) {
j.mode.ConnectEndpoints(ctx, j.connecter)