Enable async GC for all

Fixes #569
This commit is contained in:
Joseph Schorr 2015-10-19 14:22:41 -04:00
parent 601b741c4e
commit 5941f3937c
5 changed files with 2 additions and 22 deletions

View file

@ -62,11 +62,7 @@ def purge_repository(namespace_name, repository_name):
fetched.delete_instance(recursive=True, delete_nullable=False)
def find_repository_with_garbage(filter_list=None):
# TODO(jschorr): Remove the filter once we have turned the experiment on for everyone.
if filter_list is not None and not filter_list:
return None
def find_repository_with_garbage():
epoch_timestamp = get_epoch_timestamp()
try:
@ -80,9 +76,6 @@ def find_repository_with_garbage(filter_list=None):
.limit(500)
.alias('candidates'))
if filter_list:
candidates = candidates.where(Namespace.username << filter_list)
found = (RepositoryTag
.select(candidates.c.repository_id)
.from_(candidates)
@ -100,11 +93,6 @@ def find_repository_with_garbage(filter_list=None):
def garbage_collect_repository(namespace_name, repository_name):
# If the namespace is the async experiment, don't perform garbage collection here.
# TODO(jschorr): Remove this check once we have turned the experiment on for everyone.
if namespace_name in config.app_config.get('EXP_ASYNC_GARBAGE_COLLECTION', []):
return
repo = get_repository(namespace_name, repository_name)
if repo is not None:
garbage_collect_repo(repo)