コード例 #1
0
ファイル: treeitem.py プロジェクト: arashm/pootle
 def set_job_params(self, pipeline):
     """
     Sets dumped job params to Redis key
     """
     key = self.get_job_params_key()
     value = (self.keys, self.decrement)
     pipeline.set(key, dumps(value))
コード例 #2
0
ファイル: treeitem.py プロジェクト: electrolinux/pootle
 def set_job_params(self, pipeline):
     """
     Sets dumped job params to Redis key
     """
     key = self.get_job_params_key()
     value = (self.keys, self.decrement)
     pipeline.set(key, dumps(value))
コード例 #3
0
ファイル: treeitem.py プロジェクト: arashm/pootle
    def merge_job_params(self, keys, decrement, pipeline):
        """
        Merges job parameters to allow to skip one of these jobs
        """
        key = self.get_job_params_key()
        data = self.connection.get(key)
        old_keys, old_decrement = loads(data)
        new_params = (keys | old_keys, decrement + old_decrement)
        pipeline.set(key, dumps(new_params))

        return new_params
コード例 #4
0
ファイル: treeitem.py プロジェクト: electrolinux/pootle
    def merge_job_params(self, keys, decrement, pipeline):
        """
        Merges job parameters to allow to skip one of these jobs
        """
        key = self.get_job_params_key()
        data = self.connection.get(key)
        old_keys, old_decrement = loads(data)
        new_params = (keys | old_keys, decrement + old_decrement)
        pipeline.set(key, dumps(new_params))

        return new_params