Skip to content

Add option to skip language download on startup - #177

Open
StarsetNight wants to merge 1 commit into
LOOHP:mainfrom
StarsetNight:main
Open

Add option to skip language download on startup#177
StarsetNight wants to merge 1 commit into
LOOHP:mainfrom
StarsetNight:main

Conversation

@StarsetNight

Copy link
Copy Markdown

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 during onEnable, so an unreachable API blocks the whole server while the connect times out.

This PR adds a Settings.DownloadLanguagesOnStartup config option (default true). When set to false, the startup network request is skipped and the plugin simply uses the already-installed local language files, so startup completes instantly with no request to api.loohpjames.com. It also logs a friendly warning when the fetch fails, pointing users to the new option.

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.
@StarsetNight

Copy link
Copy Markdown
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. api.loohpjames.com being unreachable or the server running offline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant