func()

in go/storage/rediscache.go [83:105]


func (rc *RedisCache) SetRemove(key string, entries []string) error {
	batchSize := 1024
	for batchStart := 0; batchStart < len(entries); batchStart += batchSize {
		batchEnd := batchStart + batchSize
		if batchEnd > len(entries) {
			batchEnd = len(entries)
		}
		batch := entries[batchStart:batchEnd]
		_, err := rc.client.Pipelined(func(pipe redis.Pipeliner) error {
			for _, entry := range batch {
				err := pipe.SRem(key, entry).Err()
				if err != nil {
					return err
				}
			}
			return nil
		})
		if err != nil {
			return err
		}
	}
	return nil
}