Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] adding possibility to bulk insert in JobLoggingDB #7866

Open
wants to merge 2 commits into
base: rel-v8r0
Choose a base branch
from

Conversation

fstagni
Copy link
Contributor

@fstagni fstagni commented Nov 1, 2024

BEGINRELEASENOTES

*WMS
NEW: for parametric jobs, added the possibility to bulk insert records in JobLoggingDB

ENDRELEASENOTES

@DIRACGridBot DIRACGridBot added the alsoTargeting:integration Cherry pick this PR to integration after merge label Nov 1, 2024
@fstagni fstagni force-pushed the 80_bulkInsertJobLoggingDB branch 8 times, most recently from d5579d0 to 8fc7b77 Compare November 4, 2024 10:27
@fstagni fstagni changed the title feat: adding possibility to bulk insert in JobLoggingDB [8.0] adding possibility to bulk insert in JobLoggingDB Nov 4, 2024
@fstagni fstagni marked this pull request as ready for review November 4, 2024 10:29
)

# if JobID is a list, make a bulk insert
if isinstance(jobID, list):
for i, _ in enumerate(jobID):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zip?

cmd = cmd[:-1]
else: # else make a single insert
epoc = _date.replace(tzinfo=datetime.timezone.utc).timestamp() - MAGIC_EPOC_NUMBER
cmd = cmd + "(%d,'%s','%s','%s','%s',%f,'%s')" % (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be better to use executemany?

jobIDList, statusList, minorStatusList, date=timeStampList, source="JobManager"
)
else:
for i, _ in enumerate(jobIDList):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alsoTargeting:integration Cherry pick this PR to integration after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants