willasm / obsidian-open-weather

Obsidian plugin for OpenWeather API
MIT License
44 stars 2 forks source link

too many calls per minute #28

Closed htmljenn closed 3 weeks ago

htmljenn commented 1 month ago

I just got a note from the OpenWeather API team saying my account has been temporarily blocked for exceeding the API limit. The only tool I use that API for is this plugin. (Which I love, btw).

I have the plugin set to only check once an hour, but I really only call it twice a day in two templates I use. So why did it register 768 requests within a minute?

I have ideas that might help this:

willasm commented 1 month ago

That is very strange?? You are right that the limit is 60 times per minute but the plugin should not be getting even close to that. I have my update set to every 20 minutes and I usually have Obsidian running all day long, sometimes for several days without any problem. I just set the update to every minute and checked in devtools on the network tab and it is indeed only updating every minute. This seems like there must be some thing else going on here. Do you have any scripts or plugins that may be calling this plugin. Sounds like a script is stuck in a loop or something.

First try disabling the plugin and restarting Obsidian and see if Obsidian gives you any errors from any other plugin or scripts. Also open devtools (ctrl+shift+I) and see if any relevant errors are shown there.

Then try (with this plugin enabled) opening devtools and go to the network tab. In the initiator column you should see a bunch of plugin:open-weather entries, hover your mouse over that and you should see getForecastWeather or getCurrentWeather. These are not the API requests, just the chunks of data being sent for each of the requests. The important thing to look for is how often it is updating, you can see this by watching the scroll bar on the right. With the update set to one minute, the scroll bar gets a little smaller every 60 seconds. If it is sending 768 requests a minute the scroll bar should shrink to its smallest size instantly and the information shown will flicker as it is being updated so quickly.

Try these and let me know what results you get. Obsidian's latest 1.6 update may have caused issues for some plugins but so far I am not having any issues other than the custom css I use for the explore panel, they repositioned a lot of the elements which broke my css.

willasm commented 3 weeks ago

Did you ever find the cause for this?

As I have not heard back from you I will be closing this issue for now as this has not occurred to anyone else and I can not reproduce this myself. If you can provide more information then feel free to re-open this issue and I'll be happy to assist you.

Thanks, William.

htmljenn commented 3 weeks ago

Hi, sorry for the delay in replying. No, I never did find a cause. And it hasn't happened again. Thanks for looking into it.

willasm commented 3 weeks ago

Thanks for letting me know. If it should ever happen again please try to get a screen shot in the dev tools while it is happening. I'm very curious about what would have caused that.

Thanks, William.