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