refactor checks for activitylog and antivirus
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/events/stream"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/handlers"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/service/debug"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/version"
|
||||
@@ -17,13 +14,8 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
|
||||
checkHandler := handlers.NewCheckHandler(
|
||||
handlers.NewCheckHandlerConfiguration().
|
||||
WithLogger(options.Logger).WithCheck("nats reachability", func(ctx context.Context) error {
|
||||
_, err := stream.NatsFromConfig("healthcheckfornats", false, stream.NatsConfig(options.Config.Events))
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not connect to nats server: %v", err)
|
||||
}
|
||||
return nil
|
||||
}),
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("nats reachability", handlers.NewNatsCheck(options.Config.Events.Cluster)),
|
||||
)
|
||||
|
||||
return debug.NewService(
|
||||
|
||||
Reference in New Issue
Block a user