From 3b3e900930e554f8523248f32578da0e1ea52d1b Mon Sep 17 00:00:00 2001 From: wuaho Date: Sat, 14 Aug 2021 00:32:03 +0800 Subject: [PATCH] 1 --- settings.py | 2 +- v2/transmitter.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/settings.py b/settings.py index 0a7b0c8..9f3e298 100644 --- a/settings.py +++ b/settings.py @@ -5,7 +5,7 @@ class Config: # ck数据库连接 CK_CONFIG = {'host': '139.159.159.3', 'port': 9654, - 'send_receive_timeout': 30} + } # 每个游戏不一样 游戏上报 kafka 主题 SUBSCRIBE_TOPIC = 'xiangsu' diff --git a/v2/transmitter.py b/v2/transmitter.py index 329ba0e..746dc29 100644 --- a/v2/transmitter.py +++ b/v2/transmitter.py @@ -31,6 +31,9 @@ class Transmitter: if (p['ts'] + p['time_out'] <= ts or buffer_size >= p['bulk_max']) and buffer_size > 0: p['ts'] = ts yield tb, buffer + elif p['ts'] + p['time_out'] <= ts: + # 保持连接 + self.db_client.execute('select 1') @staticmethod def flat_data(data: dict):