fix: changing default numWorkers, making it customizable and refactoring scheduler (#1563)

Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com>
This commit is contained in:
Lisca Ana-Roberta
2023-07-04 11:03:29 +03:00
committed by GitHub
parent 7881ce32b2
commit d4f200c2e1
14 changed files with 101 additions and 29 deletions
+3 -3
View File
@@ -201,7 +201,7 @@ func createObjectsStoreDynamo(rootDir string, cacheDir string, dedupe bool, tabl
}
func runAndGetScheduler() (*scheduler.Scheduler, context.CancelFunc) {
taskScheduler := scheduler.NewScheduler(log.Logger{})
taskScheduler := scheduler.NewScheduler(config.New(), log.Logger{})
taskScheduler.RateLimit = 50 * time.Millisecond
ctx, cancel := context.WithCancel(context.Background())
@@ -2006,7 +2006,7 @@ func TestRebuildDedupeIndex(t *testing.T) {
Convey("Intrerrupt rebuilding and restart, checking idempotency", func() {
for i := 0; i < 10; i++ {
taskScheduler := scheduler.NewScheduler(log.Logger{})
taskScheduler := scheduler.NewScheduler(config.New(), log.Logger{})
taskScheduler.RateLimit = 1 * time.Millisecond
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
@@ -2045,7 +2045,7 @@ func TestRebuildDedupeIndex(t *testing.T) {
// now from dedupe false to true
for i := 0; i < 10; i++ {
taskScheduler := scheduler.NewScheduler(log.Logger{})
taskScheduler := scheduler.NewScheduler(config.New(), log.Logger{})
taskScheduler.RateLimit = 1 * time.Millisecond
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)