Merge "minimise ceilometer memory usage"

This commit is contained in:
Jenkins 2014-09-16 06:38:40 +00:00 committed by Gerrit Code Review
commit c5b76e3c9c
2 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,6 @@ from __future__ import absolute_import
import os
from oslo.config import cfg
from oslo.db.sqlalchemy import migration
from oslo.db.sqlalchemy import session as db_session
from sqlalchemy import desc
@ -87,6 +86,8 @@ class Connection(base.Connection):
)
def upgrade(self):
# NOTE(gordc): to minimise memory, only import migration when needed
from oslo.db.sqlalchemy import migration
path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'..', '..', 'storage', 'sqlalchemy',
'migrate_repo')

View File

@ -24,7 +24,6 @@ import os
from oslo.config import cfg
from oslo.db import exception as dbexc
from oslo.db.sqlalchemy import migration
from oslo.db.sqlalchemy import session as db_session
from oslo.utils import timeutils
import six
@ -227,6 +226,8 @@ class Connection(base.Connection):
)
def upgrade(self):
# NOTE(gordc): to minimise memory, only import migration when needed
from oslo.db.sqlalchemy import migration
path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
'sqlalchemy', 'migrate_repo')
migration.db_sync(self._engine_facade.get_engine(), path)