Files
HangmanLab.Backend/contexts/RequestContext.py
2024-12-03 00:10:47 +00:00

13 lines
284 B
Python

import threading
class RequestContext:
_thread_local = threading.local()
@classmethod
def set_error_id(cls, error_id):
cls._thread_local.error_id = error_id
@classmethod
def get_error_id(cls):
return getattr(cls._thread_local, "error_id", None)