update ip address to company's

This commit is contained in:
2025-10-27 15:47:04 +08:00
parent aacbe5c31c
commit 9ede603c9f
2 changed files with 26 additions and 9 deletions

12
app.py
View File

@@ -101,7 +101,7 @@ def get_trading_day_near_date(target_date):
load_trading_days() load_trading_days()
engine = create_engine( engine = create_engine(
"mysql+pymysql://root:Zzl5588161!@111.198.58.126:33060/stock?charset=utf8mb4", "mysql+pymysql://root:Zzl5588161!@222.128.1.157:33060/stock?charset=utf8mb4",
echo=False, echo=False,
pool_size=10, pool_size=10,
pool_recycle=3600, pool_recycle=3600,
@@ -110,7 +110,7 @@ engine = create_engine(
max_overflow=20 max_overflow=20
) )
engine_med = create_engine( engine_med = create_engine(
"mysql+pymysql://root:Zzl5588161!@111.198.58.126:33060/med?charset=utf8mb4", "mysql+pymysql://root:Zzl5588161!@222.128.1.157:33060/med?charset=utf8mb4",
echo=False, echo=False,
pool_size=5, pool_size=5,
pool_recycle=3600, pool_recycle=3600,
@@ -119,7 +119,7 @@ engine_med = create_engine(
max_overflow=10 max_overflow=10
) )
engine_2 = create_engine( engine_2 = create_engine(
"mysql+pymysql://root:Zzl5588161!@111.198.58.126:33060/valuefrontier?charset=utf8mb4", "mysql+pymysql://root:Zzl5588161!@222.128.1.157:33060/valuefrontier?charset=utf8mb4",
echo=False, echo=False,
pool_size=5, pool_size=5,
pool_recycle=3600, pool_recycle=3600,
@@ -204,7 +204,7 @@ app.config['COMPRESS_MIMETYPES'] = [
'application/javascript', 'application/javascript',
'application/x-javascript' 'application/x-javascript'
] ]
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:Zzl5588161!@111.198.58.126:33060/stock?charset=utf8mb4' app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:Zzl5588161!@222.128.1.157:33060/stock?charset=utf8mb4'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_ENGINE_OPTIONS'] = { app.config['SQLALCHEMY_ENGINE_OPTIONS'] = {
'pool_size': 10, 'pool_size': 10,
@@ -4576,7 +4576,7 @@ def get_stock_quotes():
def get_clickhouse_client(): def get_clickhouse_client():
return Cclient( return Cclient(
host='111.198.58.126', host='222.128.1.157',
port=18778, port=18778,
user='default', user='default',
password='Zzl33818!', password='Zzl33818!',
@@ -10159,7 +10159,7 @@ def get_daily_top_concepts():
limit = request.args.get('limit', 6, type=int) limit = request.args.get('limit', 6, type=int)
# 构建概念中心API的URL # 构建概念中心API的URL
concept_api_url = 'http://111.198.58.126:16801/search' concept_api_url = 'http://222.128.1.157:16801/search'
# 准备请求数据 # 准备请求数据
request_data = { request_data = {

View File

@@ -96,9 +96,15 @@ export const useEventNotifications = (options = {}) => {
if (alreadyConnected) { if (alreadyConnected) {
// 如果已经连接,直接更新状态 // 如果已经连接,直接更新状态
console.log('[useEventNotifications DEBUG] Socket已连接直接更新状态'); console.log('[useEventNotifications DEBUG] Socket已连接直接更新状态');
logger.info('useEventNotifications', 'Socket already connected, updating state immediately');
setIsConnected(true); setIsConnected(true);
// 验证状态更新
setTimeout(() => {
console.log('[useEventNotifications DEBUG] 1秒后验证状态更新 - isConnected应该为true');
}, 1000);
} else { } else {
// 否则建立新连接 // 否则建立新连接
console.log('[useEventNotifications DEBUG] Socket未连接开始连接...');
socketService.connect(); socketService.connect();
} }
@@ -164,14 +170,25 @@ export const useEventNotifications = (options = {}) => {
socketService.off('disconnect', handleDisconnect); socketService.off('disconnect', handleDisconnect);
socketService.off('connect_error', handleConnectError); socketService.off('connect_error', handleConnectError);
// 断开连接 // 注意:不断开连接
console.log('[useEventNotifications DEBUG] 断开 WebSocket 连接...'); // socketService 是全局单例,可能被多个组件使用
socketService.disconnect(); // 断开连接会影响其他组件,所以只移除监听器和取消订阅
console.log('[useEventNotifications DEBUG] ⚠️ 保持连接socketService是全局单例');
// socketService.disconnect(); // 注释掉,不主动断开
console.log('[useEventNotifications DEBUG] ========== 清理完成 ==========\n'); console.log('[useEventNotifications DEBUG] ========== 清理完成 ==========\n');
}; };
}, [eventType, importance, enabled]); // 移除 onNewEvent 依赖 }, [eventType, importance, enabled]); // 移除 onNewEvent 依赖
// 监控 isConnected 状态变化(调试用)
useEffect(() => {
console.log('[useEventNotifications DEBUG] ========== isConnected 状态变化 ==========');
console.log('[useEventNotifications DEBUG] isConnected:', isConnected);
console.log('[useEventNotifications DEBUG] ===========================================');
}, [isConnected]);
console.log('[useEventNotifications DEBUG] Hook返回值 - isConnected:', isConnected);
return { return {
newEvent, // 最新收到的事件 newEvent, // 最新收到的事件
isConnected, // WebSocket 连接状态 isConnected, // WebSocket 连接状态