feat: flask_nameko add params

This commit is contained in:
BryantHe 2023-10-26 12:34:08 +08:00
parent e16796b256
commit 59815cbc74
1 changed files with 3 additions and 1 deletions

View File

@ -65,11 +65,13 @@ class FlaskPooledClusterRpcProxy(PooledClusterRpcProxy):
if app:
self.init_app(app)
def init_app(self, app):
def init_app(self, app, extra_config=None):
config = dict()
for key, val in app.config.items():
if key == 'NAMEKO_AMQP_URI':
config['uri'] = val
if isinstance(extra_config, dict):
config.update(extra_config)
self.configure(config)
self._connect_on_method_call = config.get(