INNER CODE UNIT · Go

TailOps

rwynn/gtm · gtm.go:1002

func TailOps(ctx *OpCtx, client *mongo.Client, channels []OpChan, o *Options) error {
	defer ctx.allWg.Done()
	var cursor *mongo.Cursor
	var err error
	var cts primitive.Timestamp
	if o.After != nil {
		cts, _ = o.After(client, o)
	} else {
		cts, _ = LastOpTimestamp(client, o)
	}
	task := newTask(ctx.stopC)
	defer task.Done()
	for task.ctx.Err() == nil {
		cursor, err = GetOpLogCursor(client, cts, o)
		if err != nil {
			ctx.ErrC <- errors.Wrap(err, "Error establishing the oplog cursor")
			continue
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…