Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.26.0 // indirect
github.com/goaux/timer v1.1.0 // indirect
github.com/goccy/go-json v0.10.5 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/huandu/go-clone v1.6.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.26.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k=
github.com/go-playground/validator/v10 v10.26.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo=
github.com/goaux/timer v1.1.0 h1:Aj633zx1V/XN5hVI3lDBpHPZI8L1HEFsTfaNymXjyc4=
github.com/goaux/timer v1.1.0/go.mod h1:kAhAdGb1hZBiwYfzCmNYukcLMdsWgvESW1wrBbq7B54=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
Expand Down
18 changes: 13 additions & 5 deletions internal/verifier/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/10gen/migration-verifier/internal/util"
"github.com/10gen/migration-verifier/mslices"
mapset "github.com/deckarep/golang-set/v2"
"github.com/goaux/timer"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/v2/bson"
"go.mongodb.org/mongo-driver/v2/mongo"
Expand Down Expand Up @@ -119,15 +120,18 @@ func (verifier *Verifier) CheckWorker(ctxIn context.Context) error {

var finishedAllTasks bool

inProgressDone := make(chan struct{})
go func() {
defer close(inProgressDone)

delay := 30 * time.Second

time.Sleep(delay)
for {
if err := timer.SleepCause(cancelableCtx, delay); err != nil {
return
}

for cancelableCtx.Err() == nil {
verifier.PrintVerificationSummary(cancelableCtx, GenerationInProgress)

time.Sleep(delay)
}
}()

Expand All @@ -154,9 +158,13 @@ func (verifier *Verifier) CheckWorker(ctxIn context.Context) error {
time.Sleep(verifier.verificationStatusCheckInterval)
} else {
finishedAllTasks = true
verifier.PrintVerificationSummary(ctx, GenerationComplete)

// Stop the thread that prints in-progress notifications.
canceler(errors.Errorf("generation %d finished", generation))
<-inProgressDone

verifier.PrintVerificationSummary(ctx, GenerationComplete)

return nil
}
}
Expand Down
22 changes: 22 additions & 0 deletions vendor/github.com/goaux/timer/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 201 additions & 0 deletions vendor/github.com/goaux/timer/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions vendor/github.com/goaux/timer/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions vendor/github.com/goaux/timer/sleep.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading