Commit f0f4311b authored by Antoine Millet's avatar Antoine Millet

Fixed persistency bug with cache and con & ip tags.

parent 057c7b65
......@@ -94,7 +94,7 @@ class CCServer(object):
for login in to_register:
conf =
obj = TqlObject(id=login, r=conf['role'], a=login)
self.objects.register(obj, cleanable=('ip', 'con'))
for login in to_unregister:
......@@ -267,7 +267,11 @@ class ObjectsDB(object):
# The client is connected:
if parent is None:
serv_tags = client.get_tags()
# Add an infinite ttl to server defined tags:
for tag in serv_tags:
self._ttls[(obj['id'], tag)] = datetime.max
# First, check if each tag is not already cached:
now =
......@@ -314,15 +318,13 @@ class ObjectsDB(object):
return self._objects[oid]
def register(self, obj, cleanable=()):
def register(self, obj):
Populate the database with the specified object. All the tags specified
in the passed object are not declared in cache and will never be
:param obj: the object to register
:param clenable: the optionnal list of tags to declare as cleanable when
the cache is cleaned
with self._lock:
......@@ -332,8 +334,6 @@ class ObjectsDB(object):
raise AlreadyRegistered('The object is already registered')
self._objects[obj['id']] = obj
for tag in cleanable:
self._ttls[(obj['id'], tag)] = datetime.max
def unregister(self, obj_id):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment