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

Content APIs should remove old versions #197

Open
Jazcash opened this issue Apr 10, 2023 · 1 comment
Open

Content APIs should remove old versions #197

Jazcash opened this issue Apr 10, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request meta Relating to the codebase

Comments

@Jazcash
Copy link
Member

Jazcash commented Apr 10, 2023

Currently, there is no way to remove downloaded content other than deleting it from the filesystem. However, the map and game APIs don't handle this well because they store references to which content is installed in the db cache, and I don't believe they validate those entries against the filesystem to make sure they still exist.

First we need to make sure all content APIs stay synced with the actual files in the filesystem. Deleting a file from the cache should also delete it from the filesystem and vice-versa.

As for cleaning up old content, I suggest we store lastLaunched date for every version of engine/game/maps, which gets updated whenever the game API launched that content. Then we can set some configurable expiration time (e.g. 1 year), and periodically delete all content that hasn't been launched within that time (not replays ofc!). Maybe we don't want to do that for maps, but at the least we should delete old versions of maps when newer versions of them are installed, but should also consider maps downloaded to watch old replays.

@Jazcash Jazcash added enhancement New feature or request meta Relating to the codebase labels Apr 10, 2023
@Jazcash Jazcash self-assigned this Apr 10, 2023
Jazcash added a commit that referenced this issue Apr 16, 2023
@Jazcash
Copy link
Member Author

Jazcash commented Apr 16, 2023

Done for old engine versions, but can't do same for game versions until beyond-all-reason/pr-downloader#21 is implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request meta Relating to the codebase
Projects
None yet
Development

No branches or pull requests

1 participant