Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: refactor sync job process for performance #288

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading