Skip to content

Commit 5a69b4c

Browse files
authored
Merge pull request #114 from upstash/hotfix-early-stop-for-get-most-script
Add checkAtMost parameter to getMostAllowedBlocked
2 parents a239d58 + 2836bb4 commit 5a69b4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
},
2222
"license": "MIT",
2323
"dependencies": {
24-
"@upstash/core-analytics": "^0.0.9"
24+
"@upstash/core-analytics": "^0.0.10"
2525
}
2626
}

src/analytics.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ export class Analytics {
9999
return result
100100
}
101101

102-
public async getMostAllowedBlocked(timestampCount: number, getTop?: number) {
102+
public async getMostAllowedBlocked(timestampCount: number, getTop?: number, checkAtMost?: number) {
103103
getTop = getTop ?? 5
104-
return this.analytics.getMostAllowedBlocked(this.table, timestampCount, getTop)
104+
const timestamp = undefined // let the analytics handle getting the timestamp
105+
return this.analytics.getMostAllowedBlocked(this.table, timestampCount, getTop, timestamp, checkAtMost)
105106
}
106107
}

0 commit comments

Comments
 (0)