Merge branch 'master' into no-additional-init
This commit is contained in:
@@ -29,7 +29,9 @@ func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
io.WriteString(w, http.StatusText(http.StatusOK))
|
||||
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +39,8 @@ func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "text/plain")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
io.WriteString(w, http.StatusText(http.StatusOK))
|
||||
if _, err := io.WriteString(w, http.StatusText(http.StatusOK)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
|
||||
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
|
||||
"github.com/owncloud/ocis/thumbnails/pkg/proto/v0"
|
||||
svc "github.com/owncloud/ocis/thumbnails/pkg/service/v0"
|
||||
@@ -23,19 +24,26 @@ func NewService(opts ...Option) grpc.Service {
|
||||
grpc.Flags(options.Flags...),
|
||||
grpc.Version(options.Config.Server.Version),
|
||||
)
|
||||
|
||||
tconf := options.Config.Thumbnail
|
||||
gc, err := pool.GetGatewayServiceClient(tconf.RevaGateway)
|
||||
if err != nil {
|
||||
options.Logger.Error().Err(err).Msg("could not get gateway client")
|
||||
return grpc.Service{}
|
||||
}
|
||||
var thumbnail proto.ThumbnailServiceHandler
|
||||
{
|
||||
thumbnail = svc.NewService(
|
||||
svc.Config(options.Config),
|
||||
svc.Logger(options.Logger),
|
||||
svc.ThumbnailSource(imgsource.NewWebDavSource(options.Config.Thumbnail.WebDavSource)),
|
||||
svc.ThumbnailSource(imgsource.NewWebDavSource(tconf)),
|
||||
svc.ThumbnailStorage(
|
||||
storage.NewFileSystemStorage(
|
||||
options.Config.Thumbnail.FileSystemStorage,
|
||||
tconf.FileSystemStorage,
|
||||
options.Logger,
|
||||
),
|
||||
),
|
||||
svc.CS3Source(imgsource.NewCS3Source(gc)),
|
||||
svc.CS3Client(gc),
|
||||
)
|
||||
thumbnail = svc.NewInstrument(thumbnail, options.Metrics)
|
||||
thumbnail = svc.NewLogging(thumbnail, options.Logger)
|
||||
|
||||
Reference in New Issue
Block a user