Skip to content

Commit

Permalink
RF: Reflect new request usage in operators
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Oct 18, 2024
1 parent fca9ba2 commit d2c82e4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions migas/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ def add_breadcrumb(project: str, project_version: str, **kwargs) -> dict:
project=project, project_version=project_version, **kwargs
)
logger.debug(query)
_, response = request(Config.endpoint, query=query)
res = _filter_response(response, AddBreadcrumb.operation_name, AddBreadcrumb.error_response)
return res
request(Config.endpoint, query=query, wait=False)


class AddProject(Operation):
Expand Down Expand Up @@ -169,7 +167,7 @@ def add_project(project: str, project_version: str, **kwargs) -> dict:
)
query = AddProject.generate_query(project=project, project_version=project_version, **kwargs)
logger.debug(query)
_, response = request(Config.endpoint, query=query)
_, response = request(Config.endpoint, query=query, wait=True)
res = _filter_response(response, AddProject.operation_name, AddProject.error_response)
return res

Expand Down Expand Up @@ -211,7 +209,7 @@ def check_project(project: str, project_version: str, **kwargs) -> dict:
"""
query = CheckProject.generate_query(project=project, project_version=project_version, **kwargs)
logger.debug(query)
_, response = request(Config.endpoint, query=query)
_, response = request(Config.endpoint, query=query, wait=True)
res = _filter_response(response, CheckProject.operation_name)
return res

Expand All @@ -231,7 +229,7 @@ class GetUsage(Operation):
def get_usage(project: str, start: str, **kwargs) -> dict:
query = GetUsage.generate_query(project=project, start=start, **kwargs)
logger.debug(query)
_, response = request(Config.endpoint, query=query)
_, response = request(Config.endpoint, query=query, wait=True)
res = _filter_response(response, GetUsage.operation_name)
return res

Expand Down

0 comments on commit d2c82e4

Please sign in to comment.