Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-rueda committed Sep 20, 2023
1 parent 195cd89 commit 273485d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions superset/async_events/async_query_manager_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

class AsyncQueryManagerFactory:
def __init__(self) -> None:
self.async_query_manager: AsyncQueryManager = None # type: ignore
self._async_query_manager: AsyncQueryManager = None # type: ignore

def init_app(self, app: Flask) -> None:
self.async_query_manager = load_class_from_name(
self._async_query_manager = load_class_from_name(
app.config["GLOBAL_ASYNC_QUERY_MANAGER_CLASS"]
)()
self.async_query_manager.init_app(app)
self._async_query_manager.init_app(app)

def get(self) -> AsyncQueryManager:
return self.async_query_manager
def instance(self) -> AsyncQueryManager:
return self._async_query_manager
2 changes: 1 addition & 1 deletion superset/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def init_app(self, app: Flask) -> None:
APP_DIR = os.path.join(os.path.dirname(__file__), os.path.pardir)
appbuilder = AppBuilder(update_perms=False)
async_query_manager_factory = AsyncQueryManagerFactory()
async_query_manager: AsyncQueryManager = LocalProxy(async_query_manager_factory.get)
async_query_manager: AsyncQueryManager = LocalProxy(async_query_manager_factory.instance)
cache_manager = CacheManager()
celery_app = celery.Celery()
csrf = CSRFProtect()
Expand Down

0 comments on commit 273485d

Please sign in to comment.