Ejemplo n.º 1
0
    def tmp_deleted_purge(self, timeout=32):
        """After a `timeout' seconds, restore a node added in the tmp_deleted
           cache"""

        new_tmp_deleted = {}

        curt = time()
        for lvl, id in self.tmp_deleted:
            t = self.tmp_deleted[lvl, id]
            if curt-t >= timeout:
                self.node_add(lvl, id, silent=1)
            else:
                new_tmp_deleted[lvl, id] = t

        self.tmp_deleted = new_tmp_deleted
Ejemplo n.º 2
0
 def tmp_deleted_add(self, lvl, id):
     self.tmp_deleted[lvl, id] = time()
     self.node_del(lvl, id, silent=1)