mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-29 07:49:53 +01:00
refactor: do not check long term limit inside min
This commit is contained in:
parent
b3561ce425
commit
f72c768407
1 changed files with 3 additions and 8 deletions
|
@ -62,13 +62,9 @@ export class RateLimiterService {
|
||||||
if (info.remaining === 0) {
|
if (info.remaining === 0) {
|
||||||
// eslint-disable-next-line no-throw-literal
|
// eslint-disable-next-line no-throw-literal
|
||||||
throw { code: 'BRIEF_REQUEST_INTERVAL', info };
|
throw { code: 'BRIEF_REQUEST_INTERVAL', info };
|
||||||
} else {
|
|
||||||
if (hasLongTermLimit) {
|
|
||||||
await max();
|
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Long term limit
|
// Long term limit
|
||||||
|
@ -98,10 +94,9 @@ export class RateLimiterService {
|
||||||
|
|
||||||
if (hasShortTermLimit) {
|
if (hasShortTermLimit) {
|
||||||
await min();
|
await min();
|
||||||
} else if (hasLongTermLimit) {
|
}
|
||||||
|
if (hasLongTermLimit) {
|
||||||
await max();
|
await max();
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue