MCPcopy Index your code
hub / github.com/su-kaka/gcli2api / _write_to_file

Function _write_to_file

log.py:209–221  ·  view source on GitHub ↗
(message: str)

Source from the content-addressed store, hash-verified

207
208
209def _write_to_file(message: str):
210 if _file_writing_disabled:
211 return
212 # deque.append 在 CPython 受 GIL 保护,无需额外锁
213 if len(_log_deque) >= _MAX_QUEUE_SIZE:
214 return # 过载保护:丢弃而非阻塞
215 _log_deque.append(message)
216 # 非阻塞通知 writer(acquire 失败直接跳过,不影响主线程)
217 if _deque_condition.acquire(blocking=False):
218 try:
219 _deque_condition.notify()
220 finally:
221 _deque_condition.release()
222
223
224# -----------------------------------------------------------------

Callers 1

_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected