Closed akshaydhoka closed 3 years ago
@akshaydhoka Nice idea. I have added this in #318 , I have tested on *nix. Can you please test it if it works correctly for you?
@6mxo89sqh I am using the enhancments branch, but after every 10 mins it's not able to refresh the centers, currently my refresh frequency is 30 seconds
@shivaslifzz
CoWIN's api rate limit is 100 per five minute for an IP. You need to ensure you don't pass more than that. Each district and each pin contribute to an API call.
Example: Lets say i am searching for 2 pincode. At refresh rate of 5sec, my total requests in 5 min would be 120. [ I will get blocked ] At refresh rate of 6sec, my total requests in 5 min would be 100. [ I may get blocked when there are OTP calls] At refresh rate of 7sec, my total requests in 5 min would be 85. [ GOOD ]
Formula: 5 x 60 x refresh rate / no of api calls
Calculate your API calls and you should be good. If you are using Pincode based search, use option 3 as it will save your calls.
Also, if you are cowin/umang/arogya setu is open in on same network (by you or your family on same or different device) that impacts this.
@6mxo89sqh bro in the above example I am using 2 pincodes and 30 seconds refresh rate for 5mins I am only hitting 20 times only but still it's blocking at 10 mins and relased after the new otp, to reproduce the issue please use the 522002,522004 pincodes and use refresh rate as 30 seconds you will see the issue
Centers available in 522004 from 28-05-2021 as of 2021-05-28 04:21:38: 5 Centers available in 522002 from 28-05-2021 as of 2021-05-28 04:21:38: 3 ===================================================================================ly. Press Ctrl + C multiple times to exit.)) Centers available in 522004 from 28-05-2021 as of 2021-05-28 04:22:09: 5 Centers available in 522002 from 28-05-2021 as of 2021-05-28 04:22:09: 3 ===================================================================================ly. Press Ctrl + C multiple times to exit.))
@shivaslifzz Are you using CoWIN/Umang/Arogya Setu on same device or network (other mobile/laptops on same wifi)? if yes, that also contribute to the same 100 request per 5 minute limit. I have pushed the code to show warning if it is ratelimited by CoWIN. Can you take the update and check?
@6mxo89sqh I am not using CoWIN/Umang/Arogya Setu on same device or network but it's blocked after 10mins I tried it's 5 times with your branch and 2 ties with main branch and in main branch also I am seeing same issue
@6mxo89sqh please see the below example with 30 refresh rate exactly blocked after 10 mins
@6mxo89sqh now I am trying with 13 seconds refresh rate started at 2021-05-28 08:43:43 blocked after 2021-05-28 08:54:44:
I guess apart from the no of hits they might also added time duration as well!!! why because I ran the code with two diffrent frequencies 30,13 seconds but both are blocked yet exactly after 10 mins
@6mxo89sqh now I am trying with 13 seconds refresh rate started at 2021-05-28 08:43:43 blocked after 2021-05-28 08:54:44:
I guess apart from the no of hits they might also added time duration as well!!! why because I ran the code with two diffrent frequencies 30,13 seconds but both are blocked yet exactly after 10 mins
@shivaslifzz I've run in to this identical issue on the 24th, 25th & 26th of May in my PIN code. After reading your post, and running test against your PIN 522004 while facing zero issues.... heres my take on it ( and, I hope am wrong )
The only way I could replicate this issue was when ..
When I used my secondary ISP (MTNL) which does not use CGNAT, never ran in to a problem 🤔
When the whole PIN code area ( a lot of JioFiber subscribers in the dozen high rises in my hood ) is hitting the CowinAPI from behind CGNAT I got rate limited. Turned off all other devices while testing. The MTNL connection did not run in to this issue.
Someone please tell me that am wrong, and this cannot be happening. Because this kinda explains all the complaints I hear from my neighbors.
@40ZqTYY4ag3tAO4hdlxR1 This is the new change in the API Call previously we are using 15 mins window to check available slots but with the latest changes in cowin portal they limited to 10 mins if your staying more than 10 mins in the site and trying to refresh then they will block the API call , with the help of @6mxo89sqh we fixed the code by forcefully logout after every 10 mins.
@40ZqTYY4ag3tAO4hdlxR1 This is the new change in the API Call previously we are using 15 mins window to check available slots but with the latest changes in cowin portal they limited to 10 mins if your staying more than 10 mins in the site and trying to refresh then they will block the API call , so to fix this issue with the help of @6mxo89sqh we changed the code to forcefully logout after every 10 mins.
Thanks for the clarification. Glad to know my CGNAT bullshit speculation has nothing to do with it. Was worried for a while.
Closing this as it is added.
Can we have similar feature to one in main branch into this forked branch?
Commit #181 in the main branch (pallupz) During the message "No viable options..." press Enter to immediately refresh. Example:
Centers available in 560049 from 22-05-2021 as of 2021-05-21 18:16:29: 0 No viable options. Press enter to refresh immediately. Next update in 8 seconds...
Centers available in 560066 from 22-05-2021 as of 2021-05-21 18:16:35: 0 Centers available in 560067 from 22-05-2021 as of 2021-05-21 18:16:35: 0