Loading ccserver/objectsdb.py +12 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ class ObjectsDB(object): if obj_id in self._objects: self.unregister_children(obj_id) del self._objects[obj_id] self.clean_ttls(obj_id) else: raise ValueError('The object is not registered') Loading @@ -278,9 +279,20 @@ class ObjectsDB(object): for key, obj in self._objects.items(): if obj.get('__parent') is parent: del self._objects[key] self.clean_ttls(obj['id']) else: raise ValueError('The object %r is not registered' % obj_id) def clean_ttls(self, obj_id): ''' Remove TTLs for all tags for the specified object. ''' with self._lock: for oid, tag in self._ttls.keys(): if oid == obj_id: del self._ttls[(oid, tag)] def get_ids(self): ''' Get the set of all the first level ids. Loading Loading
ccserver/objectsdb.py +12 −0 Original line number Diff line number Diff line Loading @@ -263,6 +263,7 @@ class ObjectsDB(object): if obj_id in self._objects: self.unregister_children(obj_id) del self._objects[obj_id] self.clean_ttls(obj_id) else: raise ValueError('The object is not registered') Loading @@ -278,9 +279,20 @@ class ObjectsDB(object): for key, obj in self._objects.items(): if obj.get('__parent') is parent: del self._objects[key] self.clean_ttls(obj['id']) else: raise ValueError('The object %r is not registered' % obj_id) def clean_ttls(self, obj_id): ''' Remove TTLs for all tags for the specified object. ''' with self._lock: for oid, tag in self._ttls.keys(): if oid == obj_id: del self._ttls[(oid, tag)] def get_ids(self): ''' Get the set of all the first level ids. Loading