Make GC timeout configurable
This commit is contained in:
parent
e8358af589
commit
c888a8b3be
2 changed files with 4 additions and 3 deletions
|
@ -256,8 +256,8 @@ class DefaultConfig(object):
|
||||||
DOCUMENTATION_LOCATION = 'http://docs.quay.io'
|
DOCUMENTATION_LOCATION = 'http://docs.quay.io'
|
||||||
DOCUMENTATION_METADATA = 'https://coreos.github.io/quay-docs/search.json'
|
DOCUMENTATION_METADATA = 'https://coreos.github.io/quay-docs/search.json'
|
||||||
|
|
||||||
# Experiment: Async garbage collection
|
# How often the Garbage Collection worker runs.
|
||||||
EXP_ASYNC_GARBAGE_COLLECTION = []
|
GARBAGE_COLLECTION_FREQUENCY = 30 # seconds
|
||||||
|
|
||||||
# Security scanner
|
# Security scanner
|
||||||
FEATURE_SECURITY_SCANNER = False
|
FEATURE_SECURITY_SCANNER = False
|
||||||
|
|
|
@ -9,7 +9,8 @@ logger = logging.getLogger(__name__)
|
||||||
class GarbageCollectionWorker(Worker):
|
class GarbageCollectionWorker(Worker):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(GarbageCollectionWorker, self).__init__()
|
super(GarbageCollectionWorker, self).__init__()
|
||||||
self.add_operation(self._garbage_collection_repos, 30)
|
self.add_operation(self._garbage_collection_repos,
|
||||||
|
app.config.get('GARBAGE_COLLECTION_FREQUENCY', 30))
|
||||||
|
|
||||||
def _garbage_collection_repos(self):
|
def _garbage_collection_repos(self):
|
||||||
""" Performs garbage collection on repositories. """
|
""" Performs garbage collection on repositories. """
|
||||||
|
|
Reference in a new issue