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/gcworker.py

25 lines
734 B
Python
Raw Normal View History

from app import app
2017-06-28 12:13:11 +00:00
from data.database import UseThenDisconnect
2017-06-29 06:37:32 +00:00
from workers.gc.models_pre_oci import pre_oci_model as model
from workers.worker import Worker
2017-06-29 06:40:39 +00:00
class GarbageCollectionWorker(Worker):
def __init__(self):
super(GarbageCollectionWorker, self).__init__()
2015-12-16 20:41:15 +00:00
self.add_operation(self._garbage_collection_repos,
app.config.get('GARBAGE_COLLECTION_FREQUENCY', 30))
def _garbage_collection_repos(self):
""" Performs garbage collection on repositories. """
2018-12-03 15:42:53 +00:00
# TODO(jschorr): Re-enable once GC is fixed for V22.
return
2017-06-28 12:13:11 +00:00
with UseThenDisconnect(app.config):
model.perform_garbage_collection()
2017-06-29 06:40:39 +00:00
if __name__ == "__main__":
worker = GarbageCollectionWorker()
worker.start()