mirror of
https://github.com/diced/zipline.git
synced 2026-01-08 03:11:24 -08:00
fix: random type errors
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { PROP_TO_ENV } from '@/lib/config/read';
|
||||
import { Config } from '@/lib/config/validate';
|
||||
|
||||
export function checkRateLimit(config: Config) {
|
||||
if (config.ratelimit.max <= 0) throw new Error(`${PROP_TO_ENV['ratelimit.max']} must be greater than 0`);
|
||||
if (config.ratelimit.max <= 0) throw new Error('ratelimitMax must be greater than 0');
|
||||
|
||||
if (config.ratelimit.window && !config.ratelimit.max)
|
||||
throw new Error(
|
||||
`${PROP_TO_ENV['ratelimit.max']} must be set if ${PROP_TO_ENV['ratelimit.window']} is set`,
|
||||
);
|
||||
throw new Error('ratelimitMax must be set if ratelimitWindow is set');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user