Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refactore configs useUnifiedTopology #4184

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions analytics-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ Promise.all([
path: 'dist/migrations',
transactional: false,
},
driverOptions: {
useUnifiedTopology: true,
},
ensureIndexes: true,
}, [
'v2-21-0',
Expand Down
2 changes: 0 additions & 2 deletions api-gateway/configs/.env.gateway
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Gateway Service Specialized Variables
SERVICE_CHANNEL="api-gateway"
DIRECT_MESSAGE_PORT="6555"
DB_DATABASE="api-gateway"

# Ecosystem Defined Variables
HEDERA_NET="testnet"
PREUSED_HEDERA_NET="testnet"
MQ_ADDRESS="localhost"
MRV_ADDRESS="http://localhost:3003/mrv"
DB_HOST="localhost"
MQ_MAX_PAYLOAD="1048576"
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
Expand Down
2 changes: 0 additions & 2 deletions api-gateway/configs/.env.gateway.develop
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Gateway Service Specialized Variables
SERVICE_CHANNEL="api-gateway"
#DIRECT_MESSAGE_PORT="6555"
DB_DATABASE="api-gateway"

# Ecosystem Defined Variables
HEDERA_NET="testnet"
PREUSED_HEDERA_NET="testnet"
MQ_ADDRESS="localhost"
MRV_ADDRESS="http://localhost:3003/mrv"
DB_HOST="localhost"
MQ_MAX_PAYLOAD="1048576"
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
Expand Down
2 changes: 0 additions & 2 deletions api-gateway/configs/.env.gateway.template
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Gateway Service Specialized Variables
SERVICE_CHANNEL="api-gateway"
DIRECT_MESSAGE_PORT="6555"
DB_DATABASE=""

# Ecosystem Defined Variables
HEDERA_NET=""
PREUSED_HEDERA_NET=""
MQ_ADDRESS=""
MRV_ADDRESS=""
DB_HOST=""
MQ_MAX_PAYLOAD=""
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
Expand Down
1 change: 0 additions & 1 deletion auth-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Promise.all([
MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MONGO.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MONGO.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MONGO.MAX_IDLE_TIME_MS, 10),
Expand Down
1 change: 0 additions & 1 deletion common/src/helpers/mongo-logging-initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export async function mongoForLoggingInitialization(options: Record<string, any>
dbName: process.env.DB_LOGGER_NAME,
clientUrl: fixConnectionString(process.env.DB_LOGGER_HOST),
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT.MAX_IDLE_TIME_MS, 10),
Expand Down
1 change: 0 additions & 1 deletion common/src/secret-manager/migrations/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ async function migrate() {
'dist/secret-manager/migrations/vault-account.js'
],
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MIN_POOL_SIZE, RADIX),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MAX_POOL_SIZE, RADIX),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MAX_IDLE_TIME_MS, RADIX),
Expand Down
3 changes: 0 additions & 3 deletions guardian-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ Promise.all([
path: 'dist/migrations',
transactional: false
},
driverOptions: {
useUnifiedTopology: true
},
ensureIndexes: true,
entities: necessaryEntity
}, [
Expand Down
3 changes: 0 additions & 3 deletions indexer-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ Promise.all([
path: 'dist/migrations',
transactional: false,
},
driverOptions: {
useUnifiedTopology: true,
},
ensureIndexes: true,
entities,
},
Expand Down
3 changes: 0 additions & 3 deletions indexer-worker-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ Promise.all([
path: 'dist/migrations',
transactional: false
},
driverOptions: {
useUnifiedTopology: true
},
ensureIndexes: true,
entities
}, []),
Expand Down
1 change: 0 additions & 1 deletion notification-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Promise.all([
MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MONGO.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MONGO.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MONGO.MAX_IDLE_TIME_MS, 10)
Expand Down
1 change: 0 additions & 1 deletion policy-service/src/api/policy-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Promise.all([
MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MONGO.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MONGO.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MONGO.MAX_IDLE_TIME_MS, 10)
Expand Down
3 changes: 1 addition & 2 deletions policy-service/src/helpers/mongo-initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export async function mongoInitialization() {
return MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MONGO.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MONGO.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MONGO.MAX_IDLE_TIME_MS, 10),
},
ensureIndexes: true,
});
}
}
3 changes: 0 additions & 3 deletions queue-service/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const channelName = (process.env.SERVICE_CHANNEL || `queue.${GenerateUUIDv4().su
Promise.all([
MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true
},
ensureIndexes: true
}),
MessageBrokerChannel.connect('QUEUE_SERVICE'),
Expand Down
3 changes: 1 addition & 2 deletions worker-service/src/helpers/mongo-initialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ export async function mongoInitialization() {
return MikroORM.init<MongoDriver>({
...COMMON_CONNECTION_CONFIG,
driverOptions: {
useUnifiedTopology: true,
minPoolSize: parseInt(process.env.MIN_POOL_SIZE ?? DEFAULT_MONGO.MIN_POOL_SIZE, 10),
maxPoolSize: parseInt(process.env.MAX_POOL_SIZE ?? DEFAULT_MONGO.MAX_POOL_SIZE, 10),
maxIdleTimeMS: parseInt(process.env.MAX_IDLE_TIME_MS ?? DEFAULT_MONGO.MAX_IDLE_TIME_MS, 10),
},
ensureIndexes: true,
});
}
}