mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Install sentry middleware
This partially reverts commit faef68bc6fee1cdd13ab75913ea978a253b78197.
This commit is contained in:
parent
0929f0da88
commit
9ed2979d0d
@ -3,6 +3,7 @@ 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"
|
||||
@ -136,6 +137,14 @@ 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])
|
||||
WaitForShutdown(args[EnvSentryDsn] != "")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user