cleanup
This commit is contained in:
parent
c353ddbe01
commit
ce9e2df67c
310 changed files with 2550 additions and 36861 deletions
|
|
@ -2,6 +2,7 @@ import * as path from 'path';
|
|||
import { fileURLToPath } from 'url';
|
||||
import { ConfigManager, createAppConfig } from '@stock-bot/config';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
import { assertEnvironmentSafety, type StockServiceName } from './env-safety';
|
||||
import { stockAppSchema, type StockAppConfig } from './schemas';
|
||||
|
||||
let configInstance: ConfigManager<StockAppConfig> | null = null;
|
||||
|
|
@ -15,7 +16,7 @@ const __dirname = path.dirname(__filename);
|
|||
* @param serviceName - Optional service name to override port configuration
|
||||
*/
|
||||
export function initializeStockConfig(
|
||||
serviceName?: 'dataIngestion' | 'dataPipeline' | 'webApi' | 'orchestrator'
|
||||
serviceName?: StockServiceName
|
||||
): StockAppConfig {
|
||||
try {
|
||||
if (!configInstance) {
|
||||
|
|
@ -25,6 +26,7 @@ export function initializeStockConfig(
|
|||
}
|
||||
|
||||
const config = configInstance.initialize(stockAppSchema);
|
||||
assertEnvironmentSafety(config, serviceName);
|
||||
|
||||
// If a service name is provided, override the service port
|
||||
if (serviceName && config.services?.[serviceName]) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue