Skip to content

Commit

Permalink
SDA-4300 - Fix timer GitHub action issue
Browse files Browse the repository at this point in the history
  • Loading branch information
KiranNiranjan authored and Kiran Niranjan committed Sep 28, 2023
1 parent b30cd49 commit f4fc1d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// regex match the semver (semantic version) this checks for the pattern X.Y.Z
// ex-valid v1.2.0, 1.2.0, 2.3.4-r51
const semver = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?)?)?$/i;
const semver =
/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(?:-[\da-z-]+(?:\.[\da-z-]+)*)?(?:\+[\da-z-]+(?:\.[\da-z-]+)*)?)?)?$/i;
const patch = /-([0-9A-Za-z-.]+)/;

/**
Expand Down Expand Up @@ -213,7 +214,9 @@ export const throttle = (
func.apply(null, args);
lastRan = Date.now();
} else {
clearTimeout(timer);
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(() => {
if (Date.now() - lastRan >= wait) {
func.apply(null, args);
Expand Down

0 comments on commit f4fc1d3

Please sign in to comment.