We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
2 parentsb898321 +435df85 commit9fe11aaCopy full SHA for 9fe11aa
src/services/testRunner/throttle.ts
@@ -5,7 +5,7 @@ const THROTTLE_OFFSET = 300 // ms
5
6
exportconstthrottle=():Date|null=>{
7
constnow=newDate()
8
-if(now.getTime()>lastRun.getTime()+THROTTLE_OFFSET){
+if(+now>+lastRun+THROTTLE_OFFSET){
9
lastRun=now
10
returnlastRun
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
-exportconstdebounce=(startTime:Date):boolean=>lastRun===startTime
+exportconstdebounce=(startTime:Date):boolean=>+lastRun<+startTime+THROTTLE_OFFSET