fixed doc env vars + mongo v2 migration
This commit is contained in:
@@ -2,7 +2,7 @@ package transactionimp
|
||||
|
||||
import (
|
||||
"github.com/tech/sendico/pkg/db/transaction"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
)
|
||||
|
||||
type MongoTransactionFactory struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/tech/sendico/pkg/db/transaction"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
)
|
||||
|
||||
type MongoTransaction struct {
|
||||
@@ -18,8 +18,8 @@ func (mt *MongoTransaction) Execute(ctx context.Context, cb transaction.Callback
|
||||
}
|
||||
defer session.EndSession(ctx)
|
||||
|
||||
callback := func(sessCtx mongo.SessionContext) (any, error) {
|
||||
return cb(sessCtx)
|
||||
callback := func(c context.Context) (any, error) {
|
||||
return cb(c)
|
||||
}
|
||||
|
||||
return session.WithTransaction(ctx, callback)
|
||||
|
||||
Reference in New Issue
Block a user