skygragon / leetcode-cli

A cli tool to enjoy leetcode!
MIT License
3.65k stars 457 forks source link

[Feature Request] Manual Delay to avoid "http error [code=429]" #139

Open ketankr9 opened 5 years ago

ketankr9 commented 5 years ago

For non-premium users there is a minimum delay only after which next code can be run or submitted. Could you please add the functionality to enable a threshold delay before next recent submission or test.

I have happened to encounter [ERROR] http error [code=429] a number of times during code compilation/run and its frustrating. More over no one would like to see this error.

leetcode-cli can save last submission time and manually delay next submission accordingly what is enforced by leetcode.com

Btw, an awesome tool. Hope to see few major issues fixed soon.

skygragon commented 5 years ago

@ketankr9 could use leetcode cfg network:delay 5 to force a 5 seconds delay before next try.

ketankr9 commented 5 years ago

I set leetcode cfg network:delay 100, still same issue. Seems like the above command is ineffective since 100 seconds should not have caused the same error.

$$$ run
922.sort-array-by-parity-ii.0.cpp

Input data:
[4,2,5,7]
[ERROR] http error [code=429]
ketankr9@mybuntu:~/lee
$$$ leetcode cfg network:delay 100
ketankr9@mybuntu:~/lee
$$$ leetcode cfg network:delay 100
ketankr9@mybuntu:~/lee
$$$ run
922.sort-array-by-parity-ii.0.cpp

Input data:
[4,2,5,7]

Actual
  ✔ runtime: 4 ms
  ✔ answer: [4,5,2,7]
  ✔ stdout: ''

Expected
  ✔ runtime: 32 ms
  ✔ answer: [4,5,2,7]
  ✔ stdout: ''
ketankr9@mybuntu:~/lee
$$$ run
922.sort-array-by-parity-ii.0.cpp

Input data:
[4,2,5,7]
[ERROR] http error [code=429]
ketankr9@mybuntu:~/lee