Add option to skip language download on startup - #177
Open
StarsetNight wants to merge 1 commit into
Open
Conversation
Add a Settings.DownloadLanguagesOnStartup option (default true) so servers that cannot reach api.loohpjames.com, or that run offline, can skip the network request during onEnable. Adds a friendly log hint when the fetch fails.
Author
|
Complementing the workaround of manually downloading/installing the offline language packs, this should help mitigate the startup freeze reported in #144. However, please note: this change can only MITIGATE the symptom — it does NOT SOLVE the underlying network problem (i.e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Servers that cannot reach
api.loohpjames.com(blocked network, or running offline) currently wait ~30 seconds on every startup.LanguageManager.downloadTranslations()makes a synchronous HTTPS request on the server main thread duringonEnable, so an unreachable API blocks the whole server while the connect times out.This PR adds a
Settings.DownloadLanguagesOnStartupconfig option (defaulttrue). When set tofalse, the startup network request is skipped and the plugin simply uses the already-installed local language files, so startup completes instantly with no request toapi.loohpjames.com. It also logs a friendly warning when the fetch fails, pointing users to the new option.