更新push逻辑,尝试修复丢通知的bug

This commit is contained in:
murmur 2023-03-28 14:40:52 +08:00
parent b33291cdb8
commit 9115bfa8f2

View File

@ -52,6 +52,7 @@ _{datetime.datetime.now()}_
global pushisbusy
if pushisbusy:
Timer(10,s2wx).start()
return
pushisbusy=1
def send():
@ -87,12 +88,12 @@ _{datetime.datetime.now()}_
msgcache.pop(0)
if len(msgcache):
msgcache.pop(0)
t= Timer(10,s2wx).start()
Timer(10,s2wx).start()
elif (not len(content)) and len(msgcache):
# 等效超时
send()
msgcache.clear()
t= Timer(10,s2wx).start()
Timer(10,s2wx).start()
pushisbusy=0
# GET 方式
# res = requests.get(f"{SERVER}/push/{USERNAME}?title={title}"
@ -118,7 +119,7 @@ _{datetime.datetime.now()}_
# return None
# else:
# return res["message"]
t=Timer(10,s2wx).start()
Timer(10,s2wx).start()
cache = defaultdict(list)
offs = 0 # 偏移量