Skip to content

Commit d496474

Browse files
committed
feat: Allow disabling rate limit and fix parsing
1 parent 396cba6 commit d496474

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ interface RunServerOptions {
1616
verbose: boolean
1717
business: boolean
1818
manual: boolean
19-
rateLimit: number
19+
rateLimit: number | undefined
2020
}
2121

2222
export async function runServer(options: RunServerOptions): Promise<void> {
@@ -72,16 +72,20 @@ const main = defineCommand({
7272
default: false,
7373
description: "Enable manual request approval",
7474
},
75-
rateLimit: {
75+
"rate-limit": {
7676
alias: "r",
7777
type: "string",
78-
default: "5",
7978
description: "Rate limit in seconds between requests",
8079
},
8180
},
8281
run({ args }) {
82+
const rateLimitRaw = args["rate-limit"]
83+
const rateLimit =
84+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
85+
rateLimitRaw === undefined ? undefined : Number.parseInt(rateLimitRaw, 10)
86+
8387
const port = Number.parseInt(args.port, 10)
84-
const rateLimit = Number.parseInt(args.rateLimit, 10)
88+
// const rateLimit = Number.parseInt(args["rate-limit"], 10)
8589

8690
return runServer({
8791
port,

0 commit comments

Comments
 (0)