Skip to content

Commit

Permalink
Do individual insert queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin5605 committed Jul 20, 2023
1 parent b065b2c commit 5f9429e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/mainframe/endpoints/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,9 @@ async def batch_queue_package(

rows.append(scan)

async with session.begin():
for row in rows:
try:
async with session.begin_nested():
session.add(row)
except IntegrityError:
print("Skipping duplicate")
pass
await session.commit()
await session.close()
for scan in rows:
session.add(scan)
await session.commit()


@router.post(
Expand Down

0 comments on commit 5f9429e

Please sign in to comment.