mirror of
https://github.com/Unleash/unleash.git
synced 2026-02-04 20:10:52 +01:00
chore: token rate-limit sampling
This commit is contained in:
parent
25c10658c1
commit
b4acd68283
@ -170,18 +170,14 @@ export class ApiTokenService {
|
||||
}
|
||||
stopCacheTimer();
|
||||
} else {
|
||||
this.logger.debug(
|
||||
`Token ${secret.replace(
|
||||
/^([^.]*)\.(.{8}).*$/,
|
||||
'$1.$2...',
|
||||
)} rate limited until: ${this.queryAfter.get(secret)}`,
|
||||
if (Math.random() < 0.1) {
|
||||
this.logger.debug(
|
||||
`Token ${secret.replace(
|
||||
/^([^.]*)\.(.{8}).*$/,
|
||||
'$1.$2...',
|
||||
)} rate limited until: ${this.queryAfter.get(secret)}`,
|
||||
}
|
||||
if (Math.random() < 0.1) {
|
||||
this.logger.info(
|
||||
`Token ${secret.replace(
|
||||
/^([^.]*)\.(.{8}).*$/,
|
||||
'$1.$2...',
|
||||
)} rate limited until: ${this.queryAfter.get(secret)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return token;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user