impl_sqlalchemy.py (aodh-14.0.0) | : | impl_sqlalchemy.py (aodh-15.0.0) | ||
---|---|---|---|---|
skipping to change at line 105 | skipping to change at line 105 | |||
AVAILABLE_STORAGE_CAPABILITIES, | AVAILABLE_STORAGE_CAPABILITIES, | |||
) | ) | |||
def __init__(self, conf, url): | def __init__(self, conf, url): | |||
# Set max_retries to 0, since oslo.db in certain cases may attempt | # Set max_retries to 0, since oslo.db in certain cases may attempt | |||
# to retry making the db connection retried max_retries ^ 2 times | # to retry making the db connection retried max_retries ^ 2 times | |||
# in failure case and db reconnection has already been implemented | # in failure case and db reconnection has already been implemented | |||
# in storage.__init__.get_connection_from_config function | # in storage.__init__.get_connection_from_config function | |||
options = dict(conf.database.items()) | options = dict(conf.database.items()) | |||
options['max_retries'] = 0 | options['max_retries'] = 0 | |||
# FIXME(stephenfin): Remove this (and ideally use of | ||||
# LegacyEngineFacade) asap since it's not compatible with SQLAlchemy | ||||
# 2.0 | ||||
options['autocommit'] = True | ||||
# oslo.db doesn't support options defined by Aodh | # oslo.db doesn't support options defined by Aodh | |||
for opt in storage.OPTS: | for opt in storage.OPTS: | |||
options.pop(opt.name, None) | options.pop(opt.name, None) | |||
self._engine_facade = enginefacade.LegacyEngineFacade( | self._engine_facade = enginefacade.LegacyEngineFacade( | |||
self.dress_url(url), | self.dress_url(url), | |||
**options) | **options) | |||
if osprofiler_sqlalchemy: | if osprofiler_sqlalchemy: | |||
osprofiler_sqlalchemy.add_tracing(sqlalchemy, | osprofiler_sqlalchemy.add_tracing(sqlalchemy, | |||
self._engine_facade.get_engine(), | self._engine_facade.get_engine(), | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added |