We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b898321 + 435df85 commit 9fe11aaCopy full SHA for 9fe11aa
src/services/testRunner/throttle.ts
@@ -5,7 +5,7 @@ const THROTTLE_OFFSET = 300 // ms
5
6
export const throttle = (): Date | null => {
7
const now = new Date()
8
- if (now.getTime() > lastRun.getTime() + THROTTLE_OFFSET) {
+ if (+now > +lastRun + THROTTLE_OFFSET) {
9
lastRun = now
10
return lastRun
11
}
@@ -14,4 +14,4 @@ export const throttle = (): Date | null => {
14
15
// quick solution to prevent processing multiple results
16
// NOTE: may be possible to kill child process early if we migrate to tasks
17
-export const debounce = (startTime: Date): boolean => lastRun === startTime
+export const debounce = (startTime: Date): boolean => +lastRun < +startTime + THROTTLE_OFFSET
0 commit comments