api limiter & auto bp register
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import threading
|
||||
from flask import g
|
||||
class RequestContext:
|
||||
_thread_local = threading.local()
|
||||
@staticmethod
|
||||
def set_error_id(error_id):
|
||||
g.error_id = error_id
|
||||
|
||||
@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)
|
||||
@staticmethod
|
||||
def get_error_id():
|
||||
return getattr(g, "error_id", None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user