Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Oct 9, 2024
1 parent ead8675 commit d2d0e6a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions config/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"

"github.com/artie-labs/reader/constants"
"github.com/artie-labs/transfer/lib/stringutil"
)

func (s StreamingSettings) Validate() error {
Expand Down Expand Up @@ -62,12 +63,12 @@ func (m MongoDB) GetStreamingBatchSize() int32 {
}

func (m MongoDB) Validate() error {
if m.URI == "" && m.Host == "" {
return fmt.Errorf("a MongoDB host or URI is required")
if stringutil.Empty(m.Host, m.URI) {
return fmt.Errorf("one of the MongoDB settings is empty: host or URI")
}

if m.Database == "" {
return fmt.Errorf("database is empty")
return fmt.Errorf("one of the MongoDB settings is empty: database")
}

if len(m.Collections) == 0 {
Expand Down

0 comments on commit d2d0e6a

Please sign in to comment.