refactor checks for activitylog and antivirus

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2024-10-14 08:39:42 +02:00
parent c86cc619c2
commit 7d1a78cf9c
2 changed files with 8 additions and 32 deletions
@@ -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(