diff --git a/pkg/index/job/save/service/options.go b/pkg/index/job/save/service/options.go index e015dd363b..bd4c997e37 100644 --- a/pkg/index/job/save/service/options.go +++ b/pkg/index/job/save/service/options.go @@ -22,7 +22,7 @@ import ( type Option func(_ *index) error var defaultOpts = []Option{ - WithIndexingConcurrency(1), + WithSaveIndexingConcurrency(1), } // WithDiscoverer returns Option that sets discoverer client. @@ -36,11 +36,11 @@ func WithDiscoverer(client discoverer.Client) Option { } } -// WithIndexingConcurrency returns Option that sets indexing concurrency. -func WithIndexingConcurrency(num int) Option { +// WithSaveIndexingConcurrency returns Option that sets save indexing concurrency. +func WithSaveIndexingConcurrency(num int) Option { return func(idx *index) error { if num <= 0 { - return errors.NewErrInvalidOption("indexingConcurrency", num) + return errors.NewErrInvalidOption("saveIndexingConcurrency", num) } idx.concurrency = num return nil diff --git a/pkg/index/job/save/service/options_test.go b/pkg/index/job/save/service/options_test.go index 97a83b802f..b8137a55e6 100644 --- a/pkg/index/job/save/service/options_test.go +++ b/pkg/index/job/save/service/options_test.go @@ -101,7 +101,7 @@ package service // } // } // -// func TestWithIndexingConcurrency(t *testing.T) { +// func TestWithSaveIndexingConcurrency(t *testing.T) { // type args struct { // num int // } @@ -178,7 +178,7 @@ package service // checkFunc = defaultCheckFunc // } // -// got := WithIndexingConcurrency(test.args.num) +// got := WithSaveIndexingConcurrency(test.args.num) // if err := checkFunc(test.want, got); err != nil { // tt.Errorf("error = %v", err) // } diff --git a/pkg/index/job/save/usecase/save.go b/pkg/index/job/save/usecase/save.go index a230bb5a11..959eadb1b8 100644 --- a/pkg/index/job/save/usecase/save.go +++ b/pkg/index/job/save/usecase/save.go @@ -84,7 +84,7 @@ func New(cfg *config.Data) (_ runner.Runner, err error) { indexer, err := service.New( service.WithDiscoverer(discoverer), - service.WithIndexingConcurrency(cfg.Save.Concurrency), + service.WithSaveIndexingConcurrency(cfg.Save.Concurrency), service.WithTargetAddrs(cfg.Save.TargetAddrs...), ) if err != nil {