From 9c86198302abe4ad1bc3aa99543cd1bf80036043 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 21 Apr 2021 15:54:23 +0200 Subject: [PATCH] Remove icingadb.Sync.fromRedis() --- pkg/icingadb/sync.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/pkg/icingadb/sync.go b/pkg/icingadb/sync.go index 8af90bf6..16e703a0 100644 --- a/pkg/icingadb/sync.go +++ b/pkg/icingadb/sync.go @@ -166,19 +166,3 @@ func (s Sync) ApplyDelta(ctx context.Context, delta *Delta) error { return g.Wait() } - -func (s Sync) fromRedis(ctx context.Context, factoryFunc contracts.EntityFactoryFunc, key string) (<-chan contracts.Entity, <-chan error) { - // Channel for Redis field-value pairs for the specified key and errors. - pairs, errs := s.redis.HYield(ctx, key, count) - // Group for the Redis sync. Redis sync will be cancelled if an error occurs. - // Note that we're calling HYield with the original context. - g, ctx := errgroup.WithContext(ctx) - // Let errors from HYield cancel our group. - com.ErrgroupReceive(g, errs) - - desired, errs := icingaredis.CreateEntities(ctx, factoryFunc, pairs, runtime.NumCPU()) - // Let errors from CreateEntities cancel our group. - com.ErrgroupReceive(g, errs) - - return desired, com.WaitAsync(g) -}