Merge "Pick stale amphora randomly"

Zuul 2020-03-25 04:11:55 +00:00 committed by Gerrit Code Review
commit 70e244fff5
1 changed files with 3 additions and 1 deletions

View File

@ -30,6 +30,7 @@ from oslo_utils import uuidutils
from sqlalchemy.orm import joinedload
from sqlalchemy.orm import noload
from sqlalchemy.orm import subqueryload
from sqlalchemy.sql import func
from octavia.common import constants as consts
from octavia.common import data_models
@ -1521,7 +1522,8 @@ class AmphoraHealthRepository(BaseRepository):
amp = session.query(self.model_class).with_for_update().filter_by(
self.model_class.last_update < expired_time).first()
self.model_class.last_update < expired_time).order_by(
if amp is None:
return None