INNER CODE UNIT · Python

__init__

Delta-F/deltafstation · backend/app.py:27

    def __init__(self, maxsize=100):
        self.queue = []
        self.maxsize = maxsize
        self.lock = threading.Lock()

    def put(self, msg):
        """追加一条日志(空白会被过滤)。"""
        with self.lock:
            # 过滤掉一些无意义的换行或空白
            clean_msg = msg.strip()
            if not clean_msg:
                return
            # 不再重复添加时间戳,因为原始日志中通常已经包含了时间
            self.queue.append(clean_msg)
            if len(self.queue) > self.maxsize:
                self.queue.pop(0)

    def get_all(self):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…