[Notes] [Git][BuildGrid/buildgrid][finn/cli-time-period] Allow user to change time period of bot updates through the cli.



Title: GitLab

finn pushed to branch finn/cli-time-period at BuildGrid / buildgrid

Commits:

1 changed file:

Changes:

  • buildgrid/_app/commands/cmd_bot.py
    ... ... @@ -52,16 +52,19 @@ from ..cli import pass_context
    52 52
                   help="Public CAS client certificate for TLS (PEM-encoded)")
    
    53 53
     @click.option('--cas-server-cert', type=click.Path(exists=True, dir_okay=False), default=None,
    
    54 54
                   help="Public CAS server certificate for TLS (PEM-encoded)")
    
    55
    +@click.option('--update-period', type=click.FLOAT, default=0.5, show_default=True,
    
    56
    +              help="Time period the bot should update the server in seconds.")
    
    55 57
     @click.option('--parent', type=click.STRING, default='main', show_default=True,
    
    56 58
                   help="Targeted farm resource.")
    
    57 59
     @pass_context
    
    58
    -def cli(context, parent, remote, client_key, client_cert, server_cert,
    
    60
    +def cli(context, update_period, parent, remote, client_key, client_cert, server_cert,
    
    59 61
             remote_cas, cas_client_key, cas_client_cert, cas_server_cert):
    
    60 62
         # Setup the remote execution server channel:
    
    61 63
         url = urlparse(remote)
    
    62 64
     
    
    63 65
         context.remote = '{}:{}'.format(url.hostname, url.port or 50051)
    
    64 66
         context.remote_url = remote
    
    67
    +    context.update_period = update_period
    
    65 68
         context.parent = parent
    
    66 69
     
    
    67 70
         if url.scheme == 'http':
    
    ... ... @@ -139,7 +142,7 @@ def run_dummy(context):
    139 142
         updates the server.
    
    140 143
         """
    
    141 144
         try:
    
    142
    -        b = bot.Bot(context.bot_session)
    
    145
    +        b = bot.Bot(context.bot_session, context.update_period)
    
    143 146
             b.session(dummy.work_dummy,
    
    144 147
                       context)
    
    145 148
         except KeyboardInterrupt:
    



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