Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move values the mainmenu caches to dedicated file(s) #14433

Merged
merged 1 commit into from Mar 30, 2024

Conversation

sfan5
Copy link
Member

@sfan5 sfan5 commented Mar 4, 2024

It always bothered me a bit that Minetest was keeping information like the last update check in the user configuration file, but now I have a better solution to offer.
This PR moves such values to a dedicated conf file in the user's cache path.

Benefits:

  • Server list geoip and CDB update json can be cached
  • Clearing the cache makes MT recheck such things, which is reasonable behaviour
  • The settings disappear from minetest.conf.example and the settings tab. They weren't meant to be user-configurable anyway
  • Less load on CDB due to Minetest clients checking for package updates

Technical:

$path_cache/common.conf e.g.:

geoip_last_checked = 1709577888
cdb_updates_last_checked = 1709577712
no_mtg_notification = true
update_last_checked = 1709577794
geoip = EU

$path_cache/cdb/updates.json: contains the API response

To do

This PR is Ready for Review.

How to test

  1. launch Minetest with --verbose to see HTTP requests made
  2. look at files in cache path

@sfan5 sfan5 added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Feature ✨ PRs that add or enhance a feature @ Mainmenu labels Mar 4, 2024
@sfan5 sfan5 force-pushed the mmcache branch 2 times, most recently from 1522058 to ddd3f7a Compare March 4, 2024 19:11
@Zughy Zughy added the Supported by core dev Not on the roadmap, yet some core dev decided to take care of this PR label Mar 4, 2024
@rubenwardy rubenwardy self-requested a review March 8, 2024 12:02
@rubenwardy rubenwardy self-assigned this Mar 26, 2024
Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

geoip cache works
cdb cache works
no_mtg_notification is set correctly
code looks good
👍

@sfan5 sfan5 merged commit 6c6e48f into minetest:master Mar 30, 2024
15 checks passed
@sfan5 sfan5 deleted the mmcache branch March 30, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ PRs that add or enhance a feature @ Mainmenu Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements One approval ✅ ◻️ Supported by core dev Not on the roadmap, yet some core dev decided to take care of this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants