Skip to content

Commit

Permalink
refactor: refactor sync job process for performance
Browse files Browse the repository at this point in the history
Signed-off-by: Jongmin Kim <whdalsrnt@megazone.com>
  • Loading branch information
whdalsrnt committed Sep 26, 2024
1 parent 6982545 commit 71fd9ee
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/spaceone/cost_analysis/service/job_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,16 @@ def get_cost_data(self, params):
except Exception as e:
self.job_task_mgr.change_error_status(job_task_vo, e, secret_type)

self._aggregate_cost_data_with_job_task_id(
data_source_id,
domain_id,
job_id,
job_task_id,
data_source_vo.cost_data_keys,
data_source_vo.cost_additional_info_keys,
data_source_vo.cost_tag_keys,
)

self._close_job(
job_id,
data_source_id,
Expand Down Expand Up @@ -625,9 +635,9 @@ def _close_job(
if job_vo.remained_tasks == 0:
if job_vo.status == "IN_PROGRESS":
try:
self._aggregate_cost_data(
job_vo, data_keys, additional_info_keys, tag_keys
)
# self._aggregate_cost_data(
# job_vo, data_keys, additional_info_keys, tag_keys
# )

for changed_vo in job_vo.changed:
self._delete_changed_cost_data(
Expand Down Expand Up @@ -1037,9 +1047,9 @@ def _get_data_source_account_map(
)

for data_source_account_vo in data_source_account_vos:
data_source_account_map[data_source_account_vo.account_id] = (
data_source_account_vo
)
data_source_account_map[
data_source_account_vo.account_id
] = data_source_account_vo

return data_source_account_map

Expand Down

0 comments on commit 71fd9ee

Please sign in to comment.