Add profiling to scheduler

This commit is contained in:
Andre Medeiros 2022-05-27 13:27:19 -04:00
parent dc9f42de8b
commit eb853710c4

View file

@ -4,6 +4,8 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"
_ "net/http/pprof"
"strconv"
"time"
@ -100,6 +102,9 @@ func SchedulerCmd(ctx context.Context) *cobra.Command {
_, _ = s.Every(1).Minute().Do(func() { pruneDevices(ctx, logger, db) })
s.StartAsync()
srv := &http.Server{Addr: ":8080"}
go func() { _ = srv.ListenAndServe() }()
<-ctx.Done()
s.Stop()