mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 07:27:43 +00:00
Add profiling to scheduler
This commit is contained in:
parent
dc9f42de8b
commit
eb853710c4
1 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue