Keep Mongo operations online across Vault credential rotation
This commit is contained in:
1 parent
80d6917aa7
commit
23f7b78c3b
30 files changed
+1290
-202
No files matched your search
@@ -11,9 +11,9 @@ import (
|
||||
"git.sendico.io/tech/sxchnge/shared/database/record"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/repository"
|
||||
ri "git.sendico.io/tech/sxchnge/shared/database/repository/index"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/source"
|
||||
"git.sendico.io/tech/sxchnge/shared/errors"
|
||||
"git.sendico.io/tech/sxchnge/shared/logging"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -55,7 +55,7 @@ type DB struct {
|
||||
logger mlogger.Logger
|
||||
}
|
||||
|
||||
func Create(logger mlogger.Logger, database *mongo.Database, collection string) (*DB, error) {
|
||||
func Create(logger mlogger.Logger, database source.Source, collection string) (*DB, error) {
|
||||
if database == nil {
|
||||
return nil, merrors.InvalidArgument("database is required", "database")
|
||||
}
|
||||
@@ -64,7 +64,7 @@ func Create(logger mlogger.Logger, database *mongo.Database, collection string)
|
||||
collection = defaultCollection
|
||||
}
|
||||
db := &DB{
|
||||
repo: repository.CreateMongoRepository(database, collection),
|
||||
repo: repository.CreateRepository(database, collection),
|
||||
logger: logger.Named("rate_limits"),
|
||||
}
|
||||
if err := db.ensureIndexes(); err != nil {
|
||||
|
||||
Reference in new issue
Block a user