mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-09-30 03:51:43 +02:00
Instantiate new client for each spawned worker (#402)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user