- Call loadDynamicConfig() without dead supabaseService argument (Cosmos-backed). - Use getLegacySupabaseClient() for raw .from() queries in maintenance scripts. - manualOverrideCloseTrades: typed imports + legacy client for lifecycle SELECT. - verify_realtime: ESM .js imports and comment for subscribeToProfiles. - verifyTenantIsolation: comment for singleton monkey-patch. Made-with: Cursor
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { loadDynamicConfig, config } from '../src/config/index.js';
|
||
import logger from '../src/utils/logger.js';
|
||
|
||
async function testDynamicConfigLoading() {
|
||
logger.info('--- Testing Dynamic Config Loading (control-plane storage) ---');
|
||
|
||
// 1. Initial State (from .env)
|
||
const initialSymbols = [...config.SYMBOLS];
|
||
logger.info(`Initial Symbols (.env): ${initialSymbols.join(', ')}`);
|
||
|
||
// 2. Load from DB
|
||
await loadDynamicConfig();
|
||
|
||
// 3. Final State
|
||
logger.info(`Final Symbols (After DB Load): ${config.SYMBOLS.join(', ')}`);
|
||
|
||
if (JSON.stringify(initialSymbols) !== JSON.stringify(config.SYMBOLS)) {
|
||
logger.info('✅ SUCCESS: Dynamic config successfully overwrote .env defaults!');
|
||
} else {
|
||
logger.info('ℹ️ INFO: config.SYMBOLS remained the same. This is normal if DB matches .env or if DB was empty.');
|
||
}
|
||
|
||
// Check other keys if present
|
||
logger.info(`Execution Provider: ${config.EXECUTION_PROVIDER}`);
|
||
logger.info(`Total Capital: ${config.TOTAL_CAPITAL}`);
|
||
}
|
||
|
||
testDynamicConfigLoading().catch(console.error);
|