Skip to content

Commit 83ea752

Browse files
committed
revert samber/lo a bit
1 parent 26a724a commit 83ea752

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

internal/verifier/check.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,10 @@ func (verifier *Verifier) Work(ctx context.Context, workerNum int, wg *sync.Wait
362362
task, err := verifier.FindNextVerifyTaskAndUpdate()
363363
if errors.Is(err, mongo.ErrNoDocuments) {
364364
delay := verifier.workerSleepDelayMillis * time.Millisecond
365-
verifier.logger.Debug().Msgf("[Worker %d] No tasks found, sleeping %s...", workerNum, delay)
365+
verifier.logger.Debug().
366+
Stringer("duration", delay).
367+
Msgf("[Worker %d] No tasks found, sleeping ...", workerNum)
368+
366369
time.Sleep(delay)
367370
continue
368371
} else if err != nil {

internal/verifier/migration_verifier.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ import (
2626
"github.com/olekukonko/tablewriter"
2727
"github.com/pkg/errors"
2828
"github.com/rs/zerolog"
29-
"github.com/samber/lo"
3029
"go.mongodb.org/mongo-driver/bson"
3130
"go.mongodb.org/mongo-driver/bson/primitive"
3231
"go.mongodb.org/mongo-driver/mongo"
3332
"go.mongodb.org/mongo-driver/mongo/options"
3433
"go.mongodb.org/mongo-driver/mongo/readconcern"
3534
"go.mongodb.org/mongo-driver/mongo/readpref"
3635
"go.mongodb.org/mongo-driver/mongo/writeconcern"
36+
"golang.org/x/exp/maps"
3737
"golang.org/x/sync/errgroup"
3838
)
3939

@@ -754,7 +754,7 @@ func (verifier *Verifier) getShardingInfo(ctx context.Context, namespaceAndUUID
754754

755755
verifier.logger.Debug().Msgf("Collection %s is sharded with shard key %v", namespace, result.Key)
756756

757-
shardKeys = lo.Keys(result.Key)
757+
shardKeys = maps.Keys(result.Key)
758758
sort.Strings(shardKeys)
759759
}
760760
if err = cursor.Err(); err != nil {

internal/verifier/summary.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/10gen/migration-verifier/internal/types"
1717
"github.com/olekukonko/tablewriter"
1818
"github.com/samber/lo"
19+
"golang.org/x/exp/maps"
1920
)
2021

2122
const changeEventsTableMaxSize = 10
@@ -391,7 +392,7 @@ func (verifier *Verifier) printChangeEventStatistics(builder *strings.Builder) {
391392
return
392393
}
393394

394-
reverseSortedNamespaces := lo.Keys(nsTotals)
395+
reverseSortedNamespaces := maps.Keys(nsTotals)
395396
sort.Slice(
396397
reverseSortedNamespaces,
397398
func(i, j int) bool {

0 commit comments

Comments
 (0)