From 51b9c275e4cc238df3995232c26969e6579f84b5 Mon Sep 17 00:00:00 2001 From: Angelos Evripiotis Date: Tue, 2 Apr 2019 13:32:14 +0100 Subject: WIP: pickle: {ArtifactPush,Build}Queue - not needed? --- src/buildstream/_scheduler/queues/artifactpushqueue.py | 6 ++++++ src/buildstream/_scheduler/queues/buildqueue.py | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'src/buildstream') diff --git a/src/buildstream/_scheduler/queues/artifactpushqueue.py b/src/buildstream/_scheduler/queues/artifactpushqueue.py index b861d4fc7..5e9a7e839 100644 --- a/src/buildstream/_scheduler/queues/artifactpushqueue.py +++ b/src/buildstream/_scheduler/queues/artifactpushqueue.py @@ -32,6 +32,12 @@ class ArtifactPushQueue(Queue): complete_name = "Pushed" resources = [ResourceType.UPLOAD] + def __getstate__(self): + import copy + state = copy.copy(self.__dict__) + del state['_scheduler'] + return state + def process(self, element): # returns whether an artifact was uploaded or not if not element._push(): diff --git a/src/buildstream/_scheduler/queues/buildqueue.py b/src/buildstream/_scheduler/queues/buildqueue.py index caa4bc27e..34394fa65 100644 --- a/src/buildstream/_scheduler/queues/buildqueue.py +++ b/src/buildstream/_scheduler/queues/buildqueue.py @@ -34,6 +34,12 @@ class BuildQueue(Queue): complete_name = "Built" resources = [ResourceType.PROCESS, ResourceType.CACHE] + def __getstate__(self): + import copy + state = copy.copy(self.__dict__) + del state['_scheduler'] + return state + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._tried = set() -- cgit v1.2.1