mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Don't use Sentry's middleware
This commit is contained in:
parent
d1260ab268
commit
faef68bc6f
@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/getsentry/sentry-go"
|
||||
sentryhttp "github.com/getsentry/sentry-go/http"
|
||||
syncv3 "github.com/matrix-org/sliding-sync"
|
||||
"github.com/matrix-org/sliding-sync/internal"
|
||||
"github.com/matrix-org/sliding-sync/sync2"
|
||||
@ -13,7 +12,6 @@ import (
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var GitCommit string
|
||||
@ -134,14 +132,6 @@ func main() {
|
||||
h3 = otelhttp.NewHandler(h3, "Sync")
|
||||
}
|
||||
|
||||
if args[EnvSentryDsn] != "" {
|
||||
defer sentry.Flush(2 * time.Second)
|
||||
sentryHandler := sentryhttp.New(sentryhttp.Options{
|
||||
Repanic: true,
|
||||
})
|
||||
h3 = sentryHandler.Handle(h3)
|
||||
}
|
||||
|
||||
syncv3.RunSyncV3Server(h3, args[EnvBindAddr], args[EnvServer], args[EnvTLSCert], args[EnvTLSKey])
|
||||
select {} // block forever
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package sync3
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
|
||||
@ -83,6 +84,7 @@ func (c *Conn) tryRequest(ctx context.Context, req *Request) (res *Response, err
|
||||
if panicErr != nil {
|
||||
err = fmt.Errorf("panic: %s", panicErr)
|
||||
logger.Error().Msg(string(debug.Stack()))
|
||||
sentry.GetHubFromContext(ctx).RecoverWithContext(ctx, panicErr)
|
||||
}
|
||||
}()
|
||||
taskType := "OnIncomingRequest"
|
||||
|
Loading…
x
Reference in New Issue
Block a user