Remove expensive call in build badge
We don't need to list all the tags to determine if any exist, and showing the repo is ready when it is empty is probably correct behavior anyway
This commit is contained in:
parent
f0dd2e348b
commit
a949a44cb2
3 changed files with 20 additions and 5 deletions
|
@ -616,3 +616,14 @@ def list_popular_public_repos(action_count_threshold, time_span, repo_kind='imag
|
|||
.group_by(RepositoryActionCount.repository, Repository.name, Namespace.username)
|
||||
.having(fn.Sum(RepositoryActionCount.count) >= action_count_threshold)
|
||||
.tuples())
|
||||
|
||||
|
||||
def is_empty(namespace_name, repository_name):
|
||||
""" Returns if the repository referenced by the given namespace and name is empty. If the repo
|
||||
doesn't exist, returns True.
|
||||
"""
|
||||
try:
|
||||
tag.list_repository_tags(namespace_name, repository_name).limit(1).get()
|
||||
return False
|
||||
except RepositoryTag.DoesNotExist:
|
||||
return True
|
||||
|
|
Reference in a new issue