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

fast_data: skip deleting files that don't exist on disk #91

Merged
merged 1 commit into from Nov 3, 2021

Conversation

jtniehof
Copy link
Member

This one-liner fixes an issue with fast_data. It's intended to delete old versions of files but keep their records behind, while setting the exists_on_disk column to indicate it no longer exists.

The problem is with successive runs. It doesn't check this column before trying to delete, so it will delete files it's already deleted.

This PR adds a simple check for this flag and skips the deletion step if the database doesn't think the file exists. If the database thinks it exists and it's not actually there, it still errors--that's a consistentcy problem.

PR Checklist

  • Pull request has descriptive title
  • Pull request gives overview of changes
  • (N/A) New code has inline comments where necessary
  • (N/A) Any new modules, functions or classes have docstrings consistent with dbprocessing style
  • (N/A) Major new functionality has appropriate Sphinx documentation
  • (N/A) Added an entry to release notes if fixing a major bug or providing a major new feature
  • (N/A, see below) New features and bug fixes should have unit tests
  • (N/A) Relevant issues are linked in the description (use Closes # if this PR closes the issue, or some other reference, such as See # if it is related in some other way)

fast_data is currently untested (its functionality really needs to be wrapped up into main dbp), so there's no test on this.

@dnadeau-lanl dnadeau-lanl merged commit b6711a7 into spacepy:master Nov 3, 2021
@jtniehof jtniehof deleted the fast_data_check_exists branch November 4, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants