small fixes
This commit is contained in:
parent
830b9e94a1
commit
01e0fab0df
5 changed files with 13 additions and 12 deletions
2
.env
2
.env
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
# Core Application Settings
|
# Core Application Settings
|
||||||
NODE_ENV=development
|
NODE_ENV=development
|
||||||
LOG_LEVEL=info
|
LOG_LEVEL=error
|
||||||
|
|
||||||
# Data Service Configuration
|
# Data Service Configuration
|
||||||
DATA_SERVICE_PORT=2001
|
DATA_SERVICE_PORT=2001
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import { ProxyManager } from '@stock-bot/utils';
|
||||||
import { exchangeRoutes, healthRoutes, queueRoutes } from './routes';
|
import { exchangeRoutes, healthRoutes, queueRoutes } from './routes';
|
||||||
|
|
||||||
const config = initializeConfig();
|
const config = initializeConfig();
|
||||||
|
console.log('Data Service Configuration:', JSON.stringify(config, null, 2));
|
||||||
const serviceConfig = config.service;
|
const serviceConfig = config.service;
|
||||||
const databaseConfig = config.database;
|
const databaseConfig = config.database;
|
||||||
const queueConfig = config.queue;
|
const queueConfig = config.queue;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { getLogger } from '@stock-bot/logger';
|
import { getLogger } from '@stock-bot/logger';
|
||||||
import {
|
import {
|
||||||
handlerRegistry,
|
|
||||||
createJobHandler,
|
createJobHandler,
|
||||||
type HandlerConfigWithSchedule
|
handlerRegistry,
|
||||||
|
type HandlerConfigWithSchedule
|
||||||
} from '@stock-bot/queue';
|
} from '@stock-bot/queue';
|
||||||
import type { SymbolSpiderJob } from './qm.tasks';
|
import type { SymbolSpiderJob } from './qm.tasks';
|
||||||
|
|
||||||
|
|
@ -62,16 +62,17 @@ export function initializeQMProvider() {
|
||||||
{
|
{
|
||||||
type: 'session-management',
|
type: 'session-management',
|
||||||
operation: 'create-sessions',
|
operation: 'create-sessions',
|
||||||
cronPattern: '*/15 * * * * *', // Every minute
|
cronPattern: '0 */15 * * *', // Every 15 minutes
|
||||||
priority: 7,
|
priority: 7,
|
||||||
immediately: true,
|
immediately: true, // Don't run on startup to avoid blocking
|
||||||
description: 'Create and maintain QM sessions',
|
description: 'Create and maintain QM sessions',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'qm-maintnance',
|
type: 'qm-maintnance',
|
||||||
operation: 'spider-symbol-search',
|
operation: 'spider-symbol-search',
|
||||||
cronPattern: '0 0 * * 0', // Every minute
|
cronPattern: '0 0 * * 0', // Every Sunday at midnight
|
||||||
priority: 10,
|
priority: 10,
|
||||||
|
immediately: true, // Don't run on startup
|
||||||
description: 'Comprehensive symbol search using QM API',
|
description: 'Comprehensive symbol search using QM API',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -57,10 +57,9 @@
|
||||||
"retryDelay": 100
|
"retryDelay": 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"logging": {
|
"log": {
|
||||||
"level": "info",
|
"level": "info",
|
||||||
"format": "json",
|
"format": "json"
|
||||||
"prettyPrint": true
|
|
||||||
},
|
},
|
||||||
"providers": {
|
"providers": {
|
||||||
"yahoo": {
|
"yahoo": {
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@ export function getRedisConnection(config: RedisConfig) {
|
||||||
maxRetriesPerRequest: null, // Required by BullMQ
|
maxRetriesPerRequest: null, // Required by BullMQ
|
||||||
enableReadyCheck: false,
|
enableReadyCheck: false,
|
||||||
connectTimeout: isTest ? 1000 : 3000,
|
connectTimeout: isTest ? 1000 : 3000,
|
||||||
lazyConnect: true,
|
lazyConnect: false, // Changed from true to ensure connection is established immediately
|
||||||
keepAlive: false,
|
keepAlive: true, // Changed from false to maintain persistent connections
|
||||||
retryStrategy: (times: number) => {
|
retryStrategy: (times: number) => {
|
||||||
const maxRetries = isTest ? 1 : 3;
|
const maxRetries = isTest ? 1 : 3;
|
||||||
if (times > maxRetries) {
|
if (times > maxRetries) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue