"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "zaqar/storage/mongodb/queues.py" between
zaqar-9.0.0.tar.gz and zaqar-10.0.0.tar.gz

About: OpenStack Zaqar is a multi-tenant cloud messaging and notification service for web and mobile developers.
The "Ussuri" series (latest release).

queues.py  (zaqar-9.0.0):queues.py  (zaqar-10.0.0)
skipping to change at line 163 skipping to change at line 163
threshold = now - window threshold = now - window
query['c.t'] = {'$lt': threshold} query['c.t'] = {'$lt': threshold}
while True: while True:
try: try:
doc = self._collection.find_one_and_update( doc = self._collection.find_one_and_update(
query, update, return_document=ReturnDocument.AFTER, query, update, return_document=ReturnDocument.AFTER,
projection={'c.v': 1, '_id': 0}) projection={'c.v': 1, '_id': 0})
break break
except pymongo.errors.AutoReconnect as ex: except pymongo.errors.AutoReconnect:
LOG.exception(ex) LOG.exception('Auto reconnect failure')
if doc is None: if doc is None:
if window is None: if window is None:
# NOTE(kgriffs): Since we did not filter by a time window, # NOTE(kgriffs): Since we did not filter by a time window,
# the queue should have been found and updated. Perhaps # the queue should have been found and updated. Perhaps
# the queue has been deleted? # the queue has been deleted?
message = _(u'Failed to increment the message ' message = _(u'Failed to increment the message '
u'counter for queue %(name)s and ' u'counter for queue %(name)s and '
u'project %(project)s') u'project %(project)s')
message %= dict(name=name, project=project) message %= dict(name=name, project=project)
skipping to change at line 288 skipping to change at line 288
@utils.retries_on_autoreconnect @utils.retries_on_autoreconnect
@_exists.purges @_exists.purges
def _delete(self, name, project=None): def _delete(self, name, project=None):
self._collection.delete_one(_get_scoped_query(name, project)) self._collection.delete_one(_get_scoped_query(name, project))
@utils.raises_conn_error @utils.raises_conn_error
@utils.retries_on_autoreconnect @utils.retries_on_autoreconnect
def _stats(self, name, project=None): def _stats(self, name, project=None):
pass pass
@utils.raises_conn_error
@utils.retries_on_autoreconnect
def _calculate_resource_count(self, project=None):
query = utils.scoped_query(None, project, None, {})
projection = {'p_q': 1, '_id': 0}
return self._collection.find(query, projection=projection).count()
def _get_scoped_query(name, project): def _get_scoped_query(name, project):
return {'p_q': utils.scope_queue_name(name, project)} return {'p_q': utils.scope_queue_name(name, project)}
 End of changes. 2 change blocks. 
2 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)