Skip to content

Commit

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

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

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

func (m MongoDB) Validate() error {
if stringutil.Empty(m.Host, m.URI) {
return fmt.Errorf("one of the MongoDB settings is empty: host or URI")
if m.Host == "" || m.URI == "" {
return fmt.Errorf("either host or URI must be passed in")
}

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

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

0 comments on commit 7ef09f7

Please sign in to comment.