diff --git a/common/lib/idds/common/utils.py b/common/lib/idds/common/utils.py index 6d74cbc5..f361affe 100644 --- a/common/lib/idds/common/utils.py +++ b/common/lib/idds/common/utils.py @@ -625,7 +625,7 @@ def group_list(input_list, key): for item in input_list: item_key = item[key] del item[key] - item_tuple = tuple(sorted(item.items())) + item_tuple = str(tuple(sorted(item.items()))) if item_tuple not in update_groups: update_groups[item_tuple] = {'keys': [], 'items': item} update_groups[item_tuple]['keys'].append(item_key) diff --git a/main/lib/idds/orm/contents.py b/main/lib/idds/orm/contents.py index 9f256fbe..64e99bbe 100644 --- a/main/lib/idds/orm/contents.py +++ b/main/lib/idds/orm/contents.py @@ -485,10 +485,10 @@ def update_contents(parameters, use_bulk_update_mappings=False, request_id=None, """ try: - for parameter in parameters: - parameter['updated_at'] = datetime.datetime.utcnow() - if use_bulk_update_mappings: + for parameter in parameters: + parameter['updated_at'] = datetime.datetime.utcnow() + session.bulk_update_mappings(models.Content, parameters) else: groups = group_list(parameters, key='content_id') @@ -496,6 +496,7 @@ def update_contents(parameters, use_bulk_update_mappings=False, request_id=None, group = groups[group_key] keys = group['keys'] items = group['items'] + items['updated_at'] = datetime.datetime.utcnow() query = session.query(models.Content) if request_id: query = query.filter(models.Content.request_id == request_id) @@ -703,7 +704,7 @@ def get_contents_ext_maps(): 'trans_exit_code': 'transExitCode', 'pilot_error_code': 'pilotErrorCode', 'pilot_error_diag': 'pilotErrorDiag', 'exe_error_code': 'exeErrorCode', 'exe_error_diag': 'exeErrorDiag', 'sup_error_code': 'supErrorCode', 'sup_error_diag': 'supErrorDiag', 'ddm_error_code': 'ddmErrorCode', 'ddm_error_diag': 'ddmErrorDiag', - 'brokerage_error_cdode': 'brokerageErrorCode', 'brokerage_error_diag': 'brokerageErrorDiag', + 'brokerage_error_code': 'brokerageErrorCode', 'brokerage_error_diag': 'brokerageErrorDiag', 'job_dispatcher_error_code': 'jobDispatcherErrorCode', 'job_dispatcher_error_diag': 'jobDispatcherErrorDiag', 'task_buffer_error_code': 'taskBufferErrorCode', 'task_buffer_error_diag': 'taskBufferErrorDiag', 'computing_site': 'computingSite', 'computing_element': 'computingElement',