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