func (a *vAdapter) run(ctx context.Context) error {
	var cp checkpoint
	if err := a.KVStore.Get(ctx, checkpointKey, &cp); err != nil {
		logging.FromContext(ctx).Warn("get last checkpoint: ", err)
	}

	// begin of event stream defaults to current vCenter time (UTC)
	vcTime, err := methods.GetCurrentTime(ctx, a.VClient)
	if err != nil {
		return fmt.Errorf("get current time from vCenter: %w", err)
	}

	begin := getBeginFromCheckpoint(ctx, *vcTime, cp, a.CpConfig.MaxAge)
	coll, err := newHistoryCollector(ctx, a.VClient.Client, begin)
	if err != nil {
		return fmt.Errorf("create event collector: %w", err)
	}

	return a.readEvents(ctx, coll)
}
// run will start reading events from vCenter and send them to the configured
// sink. The internal vCenter event (history) collector will attempt to replay
// events starting at the current vCenter time or retrieved from a previous
// checkpoint with additional validation logic to avoid unbounded event replay.
// A checkpoint will be created periodically to track the position in the
// vCenter event stream. This allows to implement at-least-once semantics.
run will start reading events from vCenter and send them to the configured
sink. The internal vCenter event (history) collector will attempt to replay
events starting at the current vCenter time or retrieved from a previous
checkpoint with additional validation logic to avoid unbounded event replay.
A checkpoint will be created periodically to track the position in the
vCenter event stream. This allows to implement at-least-once semantics.
// run will start reading events from vCenter and send them to the configured // sink . The internal vCenter event ( history ) collector will attempt to replay // events starting at the current vCenter time or retrieved from a previous // checkpoint with additional validation logic to avoid unbounded event replay . // A checkpoint will be created periodically to track the position in the // vCenter event stream . This allows to implement at - least - once semantics .
func (a *vAdapter) run(ctx context.Context) error {
	var cp checkpoint
	if err := a.KVStore.Get(ctx, checkpointKey, &cp); err != nil {
		logging.FromContext(ctx).Warn("get last checkpoint: ", err)
	}
	vcTime, err := methods.GetCurrentTime(ctx, a.VClient)
	if err != nil {
		return fmt.Errorf("get current time from vCenter: %w", err)
	}
	begin := getBeginFromCheckpoint(ctx, *vcTime, cp, a.CpConfig.MaxAge)
	coll, err := newHistoryCollector(ctx, a.VClient.Client, begin)
	if err != nil {
		return fmt.Errorf("create event collector: %w", err)
	}
	return a.readEvents(ctx, coll)
}
func ( a * vAdapter ) run ( ctx context . Context ) error { var cp checkpoint if err := a . KVStore . Get ( ctx , checkpointKey , & cp ) ; err != nil { logging . FromContext ( ctx ) . Warn ( " " , err ) } vcTime , err := methods . GetCurrentTime ( ctx , a . VClient ) if err != nil { return fmt . Errorf ( " " , err ) } begin := getBeginFromCheckpoint ( ctx , * vcTime , cp , a . CpConfig . MaxAge ) coll , err := newHistoryCollector ( ctx , a . VClient . Client , begin ) if err != nil { return fmt . Errorf ( " " , err ) } return a . readEvents ( ctx , coll ) }
run will start reading events from vCenter and send them to the configured
sink.
run will start reading events from vCenter and send them to the configured sink .
// begin of event stream defaults to current vCenter time (UTC)