api limiter & auto bp register

This commit is contained in:
h z
2024-12-03 11:28:40 +00:00
parent a93bd5d870
commit e929f67f4e
6 changed files with 62 additions and 24 deletions

View File

@@ -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)