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

Stop auto-moving cached files #2538

Merged
merged 1 commit into from
Oct 13, 2018

Conversation

HebaruSan
Copy link
Member

Problem

#2535 created a setting to allow the user to choose a folder to use as a download cache. For convenience, it also attempted to copy cached files from the old folder to the new when the setting changed.

This just wasn't safe. First @politas had a mishap where it tried to copy the same folder to the same folder and deleted all the cached files. Then I partly scrambled my home directory just by holding backspace to clear the field in GUI. If the two developers working on some code aren't able to use it correctly, it's too error-prone and needs to be fixed.

Changes

MoveFrom now will only delete a duplicate file if the creation timestamps are different. If the same timestamp is found, then we conclude that the parent folder is the same as the destination folder, and stop copying the folder completely. This ensures that we never consider the same file a duplicate of itself and delete it.

MoveFrom also is no longer called when you change the cache folder setting. Migrating cached files is now the user's responsibility. This will prevent us from moving files to or from incorrect paths while the user is editing the field in GUI.

Maybe we'll be able to find a good way to auto-move cached files, but this pull request is just about limiting the damage.

Fixes #2537.

@HebaruSan HebaruSan added Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Pull request Network Issues affecting internet connections of CKAN labels Oct 13, 2018
@politas politas merged commit 72da29e into KSP-CKAN:master Oct 13, 2018
politas added a commit that referenced this pull request Oct 13, 2018
@HebaruSan HebaruSan deleted the fix/false-duplicate-deletion branch October 13, 2018 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Core (ckan.dll) Issues affecting the core part of CKAN Network Issues affecting internet connections of CKAN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting OneCache to same location as local cache wipes all cached files
2 participants