neoforged / NeoFormRuntime

GNU Lesser General Public License v2.1
2 stars 2 forks source link

Implement Periodic Cleanup of Cache Directories #1

Open shartte opened 4 months ago

shartte commented 4 months ago

The NFRT cache directories should be periodically cleaned up:

Investigate Gradles own rules for cleaning the caches.

lukebemish commented 1 month ago

From https://docs.gradle.org/current/userguide/directory_layout.html, gradle cleans up the cache whenever the gradle daemon shuts down, or in the foreground after a build if using --no-daemon; basically, it happens after any work has been done so it doesn't slow down the rest of the build. It's also further limited to running once per 24 hours. Files that can be recreated locally are discarded after 7 days without being accessed, files that have to be downloaded last 30 days after last being accessed. For NFRT, the "can recreate locally" ones are expensive enough they might make more sense to go in the 30 days bucket too. This is all configurable from a gradle init script. Note that this is all linked to cache folders used by a specific gradle version -- gradle doesn't clean stuff only used by a newer/older version and doesn't clean any third-party caches that happen to be in the same place.