mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 23:47:44 +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"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -100,6 +102,9 @@ func SchedulerCmd(ctx context.Context) *cobra.Command {
|
||||||
_, _ = s.Every(1).Minute().Do(func() { pruneDevices(ctx, logger, db) })
|
_, _ = s.Every(1).Minute().Do(func() { pruneDevices(ctx, logger, db) })
|
||||||
s.StartAsync()
|
s.StartAsync()
|
||||||
|
|
||||||
|
srv := &http.Server{Addr: ":8080"}
|
||||||
|
go func() { _ = srv.ListenAndServe() }()
|
||||||
|
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
|
|
||||||
s.Stop()
|
s.Stop()
|
||||||
|
|
Loading…
Reference in a new issue