diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py index 6a739e07..4358b33d 100644 --- a/kojihub/kojihub.py +++ b/kojihub/kojihub.py @@ -16116,11 +16116,13 @@ def create_rpm_checksum(rpm_id, sigkey, chsum_dict): f"rpm ID {r['rpm_id']}, sigkey {r['sigkey']} and " f"checksum type {koji.CHECKSUM_TYPES[r['checksum_type']]}.") if chsum_dict: - insert = BulkInsertProcessor(table='rpm_checksum') for func, chsum in sorted(chsum_dict.items()): - insert.add_record(rpm_id=rpm_id, sigkey=sigkey, checksum=chsum, - checksum_type=koji.CHECKSUM_TYPES[func]) - insert.execute() + data = {'rpm_id': rpm_id, + 'sigkey': sigkey, + 'checksum': chsum, + 'checksum_type': koji.CHECKSUM_TYPES[func]} + upsert = UpsertProcessor(table='rpm_checksum', data=data, skip_dup=True) + upsert.execute() def reject_draft(data, is_rpm=False, error=None):