Instantiate new client for each spawned worker (#402)

This commit is contained in:
Nikolay Edigaryev 2026-02-11 18:04:21 +01:00 committed by GitHub
parent 2b4e3b6b01
commit 5a0e6ed1d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -165,11 +165,6 @@ func runWorker(cmd *cobra.Command, args []string) (err error) {
"in the bootstrap token", ErrRunFailed)
}
controllerClient, err := client.New(clientOpts...)
if err != nil {
return err
}
// Initialize the logger
logger, err := createLogger()
if err != nil {
@ -226,6 +221,11 @@ func runWorker(cmd *cobra.Command, args []string) (err error) {
workerOptsLocal = append(workerOptsLocal, worker.WithNameSuffix(fmt.Sprintf("-%d", i+1)))
}
controllerClient, err := client.New(clientOpts...)
if err != nil {
return err
}
workerInstance, err := worker.New(controllerClient, workerOptsLocal...)
if err != nil {
return err