|
@@ -53,7 +53,7 @@ def _check(func): |
|
|
if msgId in self.receivedMsgs: |
|
|
if msgId in self.receivedMsgs: |
|
|
logger.info("Wechat message {} already received, ignore".format(msgId)) |
|
|
logger.info("Wechat message {} already received, ignore".format(msgId)) |
|
|
return |
|
|
return |
|
|
self.receivedMsgs[msgId] = cmsg |
|
|
|
|
|
|
|
|
self.receivedMsgs[msgId] = True |
|
|
create_time = cmsg.create_time # 消息时间戳 |
|
|
create_time = cmsg.create_time # 消息时间戳 |
|
|
if conf().get("hot_reload") == True and int(create_time) < int(time.time()) - 60: # 跳过1分钟前的历史消息 |
|
|
if conf().get("hot_reload") == True and int(create_time) < int(time.time()) - 60: # 跳过1分钟前的历史消息 |
|
|
logger.debug("[WX]history message {} skipped".format(msgId)) |
|
|
logger.debug("[WX]history message {} skipped".format(msgId)) |
|
@@ -105,7 +105,7 @@ class WechatChannel(ChatChannel): |
|
|
|
|
|
|
|
|
def __init__(self): |
|
|
def __init__(self): |
|
|
super().__init__() |
|
|
super().__init__() |
|
|
self.receivedMsgs = ExpiredDict(60 * 60 * 24) |
|
|
|
|
|
|
|
|
self.receivedMsgs = ExpiredDict(60 * 60) |
|
|
|
|
|
|
|
|
def startup(self): |
|
|
def startup(self): |
|
|
itchat.instance.receivingRetryCount = 600 # 修改断线超时时间 |
|
|
itchat.instance.receivingRetryCount = 600 # 修改断线超时时间 |
|
|