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:
Ralf Haferkamp
2022-09-26 16:25:56 +02:00
committed by Ralf Haferkamp
parent 0ae75f8e66
commit 01650a5023
7 changed files with 28 additions and 18 deletions
+2 -2
View File
@@ -69,8 +69,8 @@ func NewService(opts ...Option) (Service, error) {
config: conf,
log: options.Logger,
mux: m,
searchClient: searchsvc.NewSearchProviderService("com.owncloud.api.search", grpc.DefaultClient),
thumbnailsClient: thumbnailssvc.NewThumbnailService("com.owncloud.api.thumbnails", grpc.DefaultClient),
searchClient: searchsvc.NewSearchProviderService("com.owncloud.api.search", grpc.DefaultClient()),
thumbnailsClient: thumbnailssvc.NewThumbnailService("com.owncloud.api.thumbnails", grpc.DefaultClient()),
revaClient: gwc,
}