Skip to content

Commit

Permalink
Merge pull request #300 from whdalsrnt/master
Browse files Browse the repository at this point in the history
refactor: optimize query for performance
  • Loading branch information
whdalsrnt authored Oct 15, 2024
2 parents fee3ebc + bc29e98 commit 3bafd59
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/spaceone/cost_analysis/service/job_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,13 @@ def _delete_changed_cost_data(
if end:
query["filter"].append({"k": "billed_month", "v": end, "o": "lte"})

job_ids = self._distinct_job_id(
copy.deepcopy(query["filter"]), domain_id, job_vo.data_source_id
)

for key, value in change_filter.items():
query["filter"].append({"k": key, "v": value, "o": "eq"})

job_ids = self._distinct_job_id(
query["filter"], domain_id, job_vo.data_source_id
)
for job_id in job_ids:
if job_vo.job_id == job_id:
continue
Expand Down

0 comments on commit 3bafd59

Please sign in to comment.