Trees | Indices | Help |
---|
|
1 from flask_script import Command, Option 2 from coprs import db 3 from coprs.logic import coprs_logic, actions_logic 4 57 """ 8 Delete data in all chroots that are considered as outdated. That means, the chroot is EOL 9 and the preservation period is over because admin of the project didn't extend its duration. 10 """ 11 option_list = [ 12 Option("--dry-run", action="store_true", 13 help="Do not actually remove any data, but rather print information on stdout"), 14 ] 1528 29 37 38 4517 deleter = DryRunDeleter() if dry_run else Deleter() 18 19 chroots = coprs_logic.CoprChrootsLogic \ 20 .filter_outdated_to_be_deleted(coprs_logic.CoprChrootsLogic.get_multiple()) 21 for i, chroot in enumerate(chroots, start=1): 22 # This command will possibly delete a lot of chroots and can be a performance issue when committing 23 # all at once. We are going to commit every x actions to avoid that. 24 if i % 1000 == 0: 25 deleter.commit() 26 deleter.delete(chroot) 27 deleter.commit()
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |