use upsert to avoid duplicate inserts
This commit is contained in:
parent
d54dedc039
commit
1932796ef5
1 changed files with 6 additions and 4 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue