Skip to content

Commit

Permalink
fix: from to timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Cluas committed Aug 27, 2024
1 parent c72565e commit 814a2b0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pyroscope/pyroscope.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ const selectMergeProfile = async (req, res) => {
const ctx = newCtxIdx()
try {
const _req = req.body
const fromTimeSec = Math.floor(req.getStart && req.getStart()
? parseInt(req.getStart()) / 1000
: Date.now() / 1000 - HISTORY_TIMESPAN)
const toTimeSec = Math.floor(req.getEnd && req.getEnd()
? parseInt(req.getEnd()) / 1000
const fromTimeSec =
Math.floor(req.body && req.body.getStart
? parseInt(req.body.getStart()) / 1000
: (Date.now() - HISTORY_TIMESPAN) / 1000)
const toTimeSec =
Math.floor(req.body && req.body.getEnd
? parseInt(req.body.getEnd()) / 1000
: Date.now() / 1000)
let typeID = _req.getProfileTypeid && _req.getProfileTypeid()
if (!typeID) {
Expand Down

0 comments on commit 814a2b0

Please sign in to comment.