Skip to content
Snippets Groups Projects
Commit 380a8b2a authored by finnball's avatar finnball
Browse files

Do not store in action cache if non-zero exit code.

parent 09fcfc26
No related branches found
No related tags found
Loading
......@@ -27,6 +27,7 @@ from google.protobuf import any_pb2
from buildgrid.server._exceptions import NotFoundError
from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
from buildgrid._protos.google.longrunning import operations_pb2
from .job import ExecuteStage, LeaseState
......@@ -84,10 +85,13 @@ class Scheduler:
def job_complete(self, name, result):
job = self.jobs[name]
job.result = result
job.update_execute_stage(ExecuteStage.COMPLETED)
action_result = remote_execution_pb2.ActionResult()
result.Unpack(action_result)
job.result = action_result
if not job.do_not_cache and self._action_cache is not None:
self._action_cache.update_action_result(job.action_digest, result)
if action_result.exit_code:
self._action_cache.update_action_result(job.action_digest, result)
job.update_execute_stage(ExecuteStage.COMPLETED)
def get_operations(self):
response = operations_pb2.ListOperationsResponse()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment