mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-06-27 16:35:58 +00:00
chore(gRPC): register new runner
Signed-off-by: Bo-Yi.Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
a3e9bbed25
commit
449388f3ab
7 changed files with 70 additions and 46 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue