-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CLI): re-implement "node clean" (#223)
A re-implementation of "node clean" (or just "clean" in alpenhorn-1). The following changes have been made to the options available for this command: * `--acq`: Can be used multiple times to define a set of ACQs to clean * `-archive-ok`, `--force`: The `--force` flag used to do two different things: (1) skip the confirmation prompt (2) allow cleaning on archive nodes. Now `--force` only does (1), and a new flag `--archive-ok` can be used for (2). Also see the operations discussion below. for `--force`. * `--check`. Added. See the operations discussion below. * `--days`. Re-implemented using the new-ish `ArchiveFile.registered` field. This makes it behave differently from `alpenhorn-1`, where it looks at the times in the Info tables, but we don't generally use it in CHIME, so this change shouldn't be a problem. Closes #89 * `--size`. Ported from alpenhorn-1. Closes #92. * `--target`. Can be used multiple times. Files must be in ALL target groups to be cleaned. Closes #65 The clean operation runs twice, which is why it's in a separate helper function: once to find and print what would happen and then ask for confirmation, and then a second time to actually do the update. These are run completely independently because we don't want to hold the `database_proxy.atomic` lock while waiting for the user to confirm the operation. (Hence the state of the database may change while we aren't in a transaction.) The first run can be skipped with `--force`. The second run can be skipped with `--check`, or by declining the confirmation.
- Loading branch information
1 parent
cfdbeda
commit 989be6f
Showing
3 changed files
with
935 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.