Skip to content

Commit

Permalink
fix: round getRemainingTimeInMillis to nearest integer
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jul 27, 2022
1 parent 3437822 commit 2106504
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { performance } from 'node:perf_hooks'
import process from 'node:process'
import { log } from '@serverless/utils/log.js'

const { round } = Math
const { assign } = Object

const require = createRequire(import.meta.url)
Expand Down Expand Up @@ -92,7 +93,7 @@ export default class InProcessRunner {
const timeLeft = executionTimeout - performance.now()

// just return 0 for now if we are beyond alotted time (timeout)
return timeLeft > 0 ? timeLeft : 0
return timeLeft > 0 ? round(timeLeft) : 0
},
succeed: (res) => callback(null, res),
}
Expand Down

0 comments on commit 2106504

Please sign in to comment.