Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
centralise item_count
Browse files Browse the repository at this point in the history
  • Loading branch information
JimFuller-RedHat committed Feb 7, 2024
1 parent 82dde9b commit 74c09b3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions griffon/services/core_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

logger = logging.getLogger("griffon")

ITEM_BATCH = 50


class product_stream_summary:
"""retrieve product_stream summary"""
Expand Down Expand Up @@ -216,7 +218,7 @@ def execute(self, status=None) -> dict:

def async_retrieve_sources(self, purl):
params = {
"limit": 120,
"limit": ITEM_BATCH,
"root_components": "True",
"provides": purl,
"include_fields": "type,arch,nvr,purl,name,version,namespace",
Expand All @@ -230,7 +232,7 @@ def async_retrieve_sources(self, purl):

def async_retrieve_upstreams(self, purl):
params = {
"limit": 120,
"limit": ITEM_BATCH,
"root_components": "True",
"upstreams": purl,
"include_fields": "type,arch,nvr,purl,name,version,namespace",
Expand All @@ -244,7 +246,7 @@ def async_retrieve_upstreams(self, purl):

def async_retrieve_provides(self, urlparams, purl):
params = {
"limit": 120,
"limit": ITEM_BATCH,
"sources": purl,
"include_fields": "type,arch,nvr,purl,version,name,namespace",
}
Expand Down Expand Up @@ -335,7 +337,7 @@ def execute(self, status=None) -> List[Dict[str, Any]]:
status.update("searching component-registry.")
results = []
params = {
"limit": 50,
"limit": ITEM_BATCH,
"include_fields": "purl,type,name,related_url,namespace,software_build,nvr,release,version,arch,product_streams.product_versions,product_streams.name,product_streams.ofuri,product_streams.active,product_streams.exclude_components,product_streams.relations", # noqa
}
if not (self.include_inactive_product_streams):
Expand Down Expand Up @@ -800,7 +802,7 @@ def execute(self, status=None) -> List[Dict[str, Any]]:
re.escape(self.component_name) if not self.regex_name_search else self.component_name
)

cond = {}
cond = {"limit": ITEM_BATCH}
if not self.strict_name_search:
cond["re_name"] = component_name
else:
Expand Down

0 comments on commit 74c09b3

Please sign in to comment.