This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/workers/gc/models_pre_oci.py

22 lines
752 B
Python
Raw Normal View History

2017-06-28 12:13:11 +00:00
import logging
from data.model.repository import (find_repository_with_garbage, garbage_collect_repo,
get_random_gc_policy)
2017-06-29 06:37:32 +00:00
from workers.gc.models_interface import GCWorkerDataInterface
2017-06-28 12:13:11 +00:00
logger = logging.getLogger(__name__)
class PreOCIModel(GCWorkerDataInterface):
def perform_garbage_collection(self):
repository = find_repository_with_garbage(get_random_gc_policy())
if repository is None:
logger.debug('No repository with garbage found')
return
logger.debug('Starting GC of repository #%s (%s)', repository.id, repository.name)
garbage_collect_repo(repository)
logger.debug('Finished GC of repository #%s (%s)', repository.id, repository.name)
pre_oci_model = PreOCIModel()