[Notes] [Git][BuildGrid/buildgrid][mablanch/117-job-scheduler-refactoring] bots/dummy.py: Return an empty action result



Title: GitLab

Martin Blanchard pushed to branch mablanch/117-job-scheduler-refactoring at BuildGrid / buildgrid

Commits:

1 changed file:

Changes:

  • buildgrid/_app/bots/dummy.py
    ... ... @@ -16,9 +16,18 @@
    16 16
     import random
    
    17 17
     import time
    
    18 18
     
    
    19
    +from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
    
    20
    +
    
    19 21
     
    
    20 22
     def work_dummy(context, lease):
    
    21 23
         """ Just returns lease after some random time
    
    22 24
         """
    
    25
    +    lease.result.Clear()
    
    26
    +
    
    23 27
         time.sleep(random.randint(1, 5))
    
    28
    +
    
    29
    +    action_result = remote_execution_pb2.ActionResult()
    
    30
    +
    
    31
    +    lease.result.Pack(action_result)
    
    32
    +
    
    24 33
         return lease



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]