finish
This commit is contained in:
9
font.py
9
font.py
@@ -54,9 +54,11 @@ class Font:
|
||||
|
||||
d = binascii.unhexlify(parts[2])
|
||||
self.cache[c] = d
|
||||
# 清除重试计数(如果有)
|
||||
# 清除重试计数(如果有)和 pending
|
||||
if c in self.retry_count:
|
||||
del self.retry_count[c]
|
||||
if c in self.pending_requests:
|
||||
self.pending_requests.remove(c)
|
||||
return True
|
||||
except Exception as e:
|
||||
print(f"Font data parse error: {e}")
|
||||
@@ -110,6 +112,11 @@ class Font:
|
||||
if wait:
|
||||
print(f"Batch requesting fonts: {req_str}")
|
||||
try:
|
||||
# Add Pending requests to retry count to avoid spamming
|
||||
for c in missing_list:
|
||||
if c not in self.pending_requests:
|
||||
self.pending_requests.add(c)
|
||||
|
||||
self.ws.send(f"GET_FONTS_BATCH:{req_str}")
|
||||
if wait:
|
||||
self._wait_for_fonts(missing_codes)
|
||||
|
||||
Reference in New Issue
Block a user