refactored monorepo for more projects
This commit is contained in:
parent
4632c174dc
commit
9492f1b15e
180 changed files with 1438 additions and 424 deletions
|
|
@ -20,7 +20,7 @@ export function registerDatabaseServices(
|
|||
port: parseInt(uriMatch?.[4] || '27017'),
|
||||
database: config.mongodb.database,
|
||||
username: uriMatch?.[1],
|
||||
password: uriMatch?.[2],
|
||||
password: uriMatch?.[2] ? String(uriMatch?.[2]) : undefined,
|
||||
authSource: uriMatch?.[6] || 'admin',
|
||||
uri: config.mongodb.uri,
|
||||
};
|
||||
|
|
@ -37,16 +37,19 @@ export function registerDatabaseServices(
|
|||
if (config.postgres.enabled) {
|
||||
container.register({
|
||||
postgresClient: asFunction(({ logger }) => {
|
||||
return new PostgreSQLClient(
|
||||
{
|
||||
host: config.postgres.host,
|
||||
port: config.postgres.port,
|
||||
database: config.postgres.database,
|
||||
username: config.postgres.user,
|
||||
password: config.postgres.password,
|
||||
},
|
||||
logger
|
||||
);
|
||||
const pgConfig = {
|
||||
host: config.postgres.host,
|
||||
port: config.postgres.port,
|
||||
database: config.postgres.database,
|
||||
username: config.postgres.user,
|
||||
password: String(config.postgres.password), // Ensure password is a string
|
||||
};
|
||||
|
||||
logger.debug('PostgreSQL config:', {
|
||||
...pgConfig,
|
||||
password: pgConfig.password ? '***' : 'NO_PASSWORD',
|
||||
});
|
||||
return new PostgreSQLClient(pgConfig, logger);
|
||||
}).singleton(),
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -56,19 +56,12 @@ export function registerApplicationServices(
|
|||
db: config.redis.db,
|
||||
},
|
||||
defaultQueueOptions: {
|
||||
workers: 1,
|
||||
concurrency: 1,
|
||||
defaultJobOptions: {
|
||||
removeOnComplete: 100,
|
||||
removeOnFail: 50,
|
||||
attempts: 3,
|
||||
backoff: {
|
||||
type: 'exponential',
|
||||
delay: 1000,
|
||||
},
|
||||
},
|
||||
workers: config.queue!.workers || 1,
|
||||
concurrency: config.queue!.concurrency || 1,
|
||||
defaultJobOptions: config.queue!.defaultJobOptions,
|
||||
},
|
||||
enableScheduledJobs: true,
|
||||
enableScheduledJobs: config.queue!.enableScheduledJobs ?? true,
|
||||
delayWorkerStart: config.queue!.delayWorkerStart ?? false,
|
||||
};
|
||||
return new QueueManager(queueConfig, logger);
|
||||
}).singleton(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue