Skip to content

Commit 9fe11aa

Browse files
authored
Merge pull request #309 from coderoad/feature/fix-continue
fix test runner throttle
2 parents b898321 + 435df85 commit 9fe11aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/testRunner/throttle.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const THROTTLE_OFFSET = 300 // ms
55

66
export const throttle = (): Date | null => {
77
const now = new Date()
8-
if (now.getTime() > lastRun.getTime() + THROTTLE_OFFSET) {
8+
if (+now > +lastRun + THROTTLE_OFFSET) {
99
lastRun = now
1010
return lastRun
1111
}
@@ -14,4 +14,4 @@ export const throttle = (): Date | null => {
1414

1515
// quick solution to prevent processing multiple results
1616
// NOTE: may be possible to kill child process early if we migrate to tasks
17-
export const debounce = (startTime: Date): boolean => lastRun === startTime
17+
export const debounce = (startTime: Date): boolean => +lastRun < +startTime + THROTTLE_OFFSET

0 commit comments

Comments
 (0)