Use lazy initialization for the default grpc client
This avoids using a public global variable. It allows us to initialize the default client a bit later (outside of init()). That way we can e.g. properly initialize the in-memory registry.
This commit is contained in:
committed by
Ralf Haferkamp
parent
0ae75f8e66
commit
01650a5023
@@ -37,7 +37,7 @@ func Index(cfg *config.Config) *cli.Command {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
client := searchsvc.NewSearchProviderService("com.owncloud.api.search", grpc.DefaultClient)
|
||||
client := searchsvc.NewSearchProviderService("com.owncloud.api.search", grpc.DefaultClient())
|
||||
_, err := client.IndexSpace(context.Background(), &searchsvc.IndexSpaceRequest{
|
||||
SpaceId: c.String("space"),
|
||||
UserId: c.String("user"),
|
||||
|
||||
Reference in New Issue
Block a user