resource impl
This commit is contained in:
12
contexts/RequestContext.py
Normal file
12
contexts/RequestContext.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
|
||||
0
contexts/__init__.py
Normal file
0
contexts/__init__.py
Normal file
Reference in New Issue
Block a user