aclist / kbin-kes

Add-on manager and scripting framework for kbin
MIT License
24 stars 8 forks source link

[Discussion] Add sleep to GET requests #21

Closed aclist closed 6 months ago

aclist commented 1 year ago

Idea: consolidate into a unified script containing all functions

Oricul commented 1 year ago

While I'm sure some licenses would allow for this, I'm not sure it's the right way to go about things even if they do. The script would become gigantic and unwieldy.

A script that is set as required is automatically cached by TamperMonkey anyway. You can view this by going to your dashboard, clicking on your script, in this case kbin-megamod, and going to the Externals tab.

aclist commented 1 year ago

Yes, I'm aware that it is cached, but we still have to load them at least once the first time, and there's the possibility of having several dozen-odd scripts that have to be sourced in series, perhaps more.

From what I have seen, most follow MIT licenses.

I suppose the worst that could happen is you fail to load the Nth script, you are rate limited, then the next time you try you start fetching them again from the Nth script until they are all cached.

GitHub's rate limiting falls somewhere between permissive and strict, about in the middle.

Oricul commented 1 year ago

Perhaps instead we should look at a "first load initialization" that slows the rate at which scripts are preloaded?

aclist commented 1 year ago

That seems reasonable. I haven't actually run into any rate limiting in "production" with this script, but it has happened to me in the past when querying GH in general, so I am trying to think ahead.

aclist commented 1 year ago

Currently intractable unless sourcing the required scripts inline, as there is no method of hijacking GM's own request logic. Low priority