Skip to content

Commit

Permalink
Add demo time to endpoint mhandler
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Oct 18, 2022
1 parent 26b1f31 commit ac7e05d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mhandlers/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/pritunl/pritunl-zero/endpoint"
"github.com/pritunl/pritunl-zero/errortypes"
"github.com/pritunl/pritunl-zero/event"
"github.com/pritunl/pritunl-zero/settings"
"github.com/pritunl/pritunl-zero/utils"
)

Expand Down Expand Up @@ -307,6 +308,10 @@ func endpointChartGet(c *gin.Context) {
}

startTime := time.Now().UTC().Add(time.Duration(-period) * time.Minute)
if settings.System.Demo {
startTime = time.Unix(1666116143, 0).Add(
time.Duration(-period) * time.Minute)
}
endTime := time.Now().UTC()

data, err := endpt.GetChart(c, db, resource, startTime,
Expand Down

0 comments on commit ac7e05d

Please sign in to comment.