Remove small duplication from message storage
There is some duplicate code in mongodb message storage code, which now leaves in the queue module. Let's remove it. Change-Id: Ib95b8fd6ad1afa284b0865e6af7461e666fb0e11
This commit is contained in:
parent
73ddab3cd6
commit
49d8dd143e
@ -988,19 +988,6 @@ def _basic_message(msg, now):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# NOTE(kgriffs): E.g.: 'queuecontroller:exists:5083853/my-queue'
|
|
||||||
_QUEUE_CACHE_PREFIX = 'queuecontroller:'
|
|
||||||
|
|
||||||
_QUEUE_CACHE_TTL = 5
|
|
||||||
|
|
||||||
|
|
||||||
def _queue_exists_key(queue, project=None):
|
|
||||||
# NOTE(kgriffs): Use string concatenation for performance,
|
|
||||||
# also put project first since it is guaranteed to be
|
|
||||||
# unique, which should reduce lookup time.
|
|
||||||
return _QUEUE_CACHE_PREFIX + 'exists:' + str(project) + '/' + queue
|
|
||||||
|
|
||||||
|
|
||||||
class MessageQueueHandler(object):
|
class MessageQueueHandler(object):
|
||||||
|
|
||||||
def __init__(self, driver, control_driver):
|
def __init__(self, driver, control_driver):
|
||||||
|
Loading…
Reference in New Issue
Block a user