chore(gRPC): register new runner

Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi.Wu
2022-08-28 14:05:56 +08:00
committed by Jason Song
parent a3e9bbed25
commit 449388f3ab
7 changed files with 70 additions and 46 deletions

View File

@ -71,7 +71,17 @@ func runDaemon(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command,
Environ: cfg.Runner.Environ,
}
poller := poller.New(cli, runner.Run)
poller := poller.New(
cli,
runner.Run,
&client.Filter{
Kind: runtime.Kind,
Type: runtime.Type,
OS: cfg.Platform.OS,
Arch: cfg.Platform.Arch,
Capacity: cfg.Runner.Capacity,
},
)
g.Go(func() error {
log.WithField("capacity", cfg.Runner.Capacity).
@ -80,8 +90,7 @@ func runDaemon(ctx context.Context, task *runtime.Task) func(cmd *cobra.Command,
WithField("arch", cfg.Platform.Arch).
Infoln("polling the remote server")
poller.Poll(ctx, cfg.Runner.Capacity)
return nil
return poller.Poll(ctx, cfg.Runner.Capacity)
})
err = g.Wait()