diff --git a/cmd/newsletter/main.go b/cmd/newsletter/main.go index 4b14420..dfc5612 100644 --- a/cmd/newsletter/main.go +++ b/cmd/newsletter/main.go @@ -50,6 +50,8 @@ func main() { signalCh <- syscall.SIGTERM } + slog.Info("connected successfully to MongoDB instance") + storage := mongodb.NewNLStorage(client, "newsletter") err = storage.SaveEngineer(ctx, mongodb.Engineer{ diff --git a/mongodb/db.go b/mongodb/db.go index 00425de..31a3425 100644 --- a/mongodb/db.go +++ b/mongodb/db.go @@ -4,7 +4,6 @@ package mongodb import ( "context" "fmt" - "log/slog" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" @@ -21,8 +20,6 @@ func OpenDB(ctx context.Context, cfg Config) (*mongo.Client, error) { return nil, fmt.Errorf("MongoDB URI is empty") } - slog.Info("connected successfully to MongoDB instance") - bsonOpts := &options.BSONOptions{ UseJSONStructTags: true, NilSliceAsEmpty: true,