Skip to content

Commit

Permalink
fix: adjust preversion script
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Nov 19, 2021
1 parent 902819c commit 33f07fb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"scripts": {
"prebuild": "rimraf dist",
"preversion": "yarn run format && yarn run lint && yarn build",
"preversion": "yarn run format && yarn run lint && git add -A && yarn build",
"build": "nest build",
"commit": "git-cz",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
Expand Down
10 changes: 9 additions & 1 deletion src/throttler-storage-redis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ export class ThrottlerStorageRedisService implements ThrottlerStorageRedis, OnMo
}

async getRecord(key: string): Promise<number[]> {
const ttls = (await this.redis.scan(0, 'MATCH', `${this.redis.options?.keyPrefix}${key}:*`, 'COUNT', this.scanCount)).pop();
const ttls = (
await this.redis.scan(
0,
'MATCH',
`${this.redis.options?.keyPrefix}${key}:*`,
'COUNT',
this.scanCount,
)
).pop();
return (ttls as string[]).map((k) => parseInt(k.split(':').pop())).sort();
}

Expand Down

0 comments on commit 33f07fb

Please sign in to comment.