fix: disable profiler in production mode

Closes #4921
This commit is contained in:
Maximilian Krauß 2025-07-29 07:07:16 +02:00
parent 8f51791da8
commit c565d139ea
No known key found for this signature in database
1 changed files with 6 additions and 4 deletions

View File

@ -52,10 +52,12 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store
echoServer.Use(middleware.Recover())
s.echoServer = echoServer
// Initialize profiler
s.profiler = profiler.NewProfiler()
s.profiler.RegisterRoutes(echoServer)
s.profiler.StartMemoryMonitor(ctx)
if profile.Mode != "prod" {
// Initialize profiler
s.profiler = profiler.NewProfiler()
s.profiler.RegisterRoutes(echoServer)
s.profiler.StartMemoryMonitor(ctx)
}
workspaceBasicSetting, err := s.getOrUpsertWorkspaceBasicSetting(ctx)
if err != nil {