perf👌: 实现优化webui群组/好友管理api

This commit is contained in:
HibiKier
2024-01-09 13:47:24 +08:00
parent 9a1510fe7e
commit bf55a20241
7 changed files with 443 additions and 95 deletions
+1 -12
View File
@@ -21,18 +21,6 @@ class LogStorage(Generic[_T]):
self.listeners: Set[LogListener[str]] = set()
async def add(self, log: str):
# log = re.sub(PATTERN, "", log)
# log_split = log.split()
# time = log_split[0] + " " + log_split[1]
# level = log_split[2]
# main = log_split[3]
# type_ = None
# log_ = " ".join(log_split[3:])
# if "Calling API" in log_:
# sp = log_.split("|")
# type_ = sp[1]
# log_ = "|".join(log_[1:])
# data = {"time": time, "level": level, "main": main, "type": type_, "log": log_}
seq = self.count = self.count + 1
self.logs[seq] = log
asyncio.get_running_loop().call_later(self.rotation, self.remove, seq)
@@ -48,3 +36,4 @@ class LogStorage(Generic[_T]):
LOG_STORAGE: LogStorage[str] = LogStorage[str]()