Waiting to start.
# frozen_string_literal: true
# This class handles the import of agent port data for the maintenance module.
# Processes CSV rows to update agent port information in the database.
class Maintenance::AgentPortDataTask < MaintenanceTasks::Task
include DatadogTrace
csv_collection
HEADER_MBO_ID = 'MBO_ID'
HEADER_COMPANY_GUID = 'COMPANY_GUID'
report_on(StandardError)
def process(row)
mbo_id, company_guid = extract_ids(row)
tree_node = with_trace { find_tree_node(mbo_id) }
return unless tree_node
update_tree_node(tree_node, mbo_id, company_guid)
end
private
def update_tree_node(tree_node, mbo_id, company_guid)
with_trace(tags: { mbo_id:, company_guid: }) do
tree_node.update!(company_guid:)
end
end
def find_tree_node(mbo_id)
TreeNode.joins(:mbo_profiles).find_sole_by(mbo_profiles: { mbo_id: })
end
def extract_ids(row)
row.to_h.fetch_values(HEADER_MBO_ID, HEADER_COMPANY_GUID)
end
end
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError
Processed 0 items.
Ran for less than 5 seconds until an error happened .
ActiveStorage::FileNotFoundError
ActiveStorage::FileNotFoundError