Skip to content

Commit a62eec7

Browse files
authored
Merge pull request #5725 from DIRACGridBot/cherry-pick-2-572fafe16-integration
[sweep:integration] fix: ElasticJobParametersDB: get in output all entries
2 parents 2e353c2 + a758179 commit a62eec7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DIRAC/WorkloadManagementSystem/DB/ElasticJobParametersDB.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self):
6363
self.log.always("Index created:", self.indexName)
6464

6565
self.dslSearch = self._Search(self.indexName)
66+
self.dslSearch.extra(track_total_hits=True)
6667

6768
def getJobParameters(self, jobID, paramList=None):
6869
"""Get Job Parameters defined for jobID.
@@ -99,7 +100,7 @@ def getJobParameters(self, jobID, paramList=None):
99100

100101
s = self.dslSearch.query("bool", filter=self._Q("term", JobID=jobID))
101102

102-
res = s.execute()
103+
res = s.scan()
103104

104105
for hit in res:
105106
name = hit.Name
@@ -142,7 +143,7 @@ def setJobParameters(self, jobID, parameters):
142143
self.log.debug("Inserting parameters", "in %s: for job %s : %s" % (self.indexName, jobID, parameters))
143144

144145
parametersListDict = [
145-
{"JobID": jobID, "Name": parName, "Value": parValue, "_id": str(parName) + str(parValue)}
146+
{"JobID": jobID, "Name": parName, "Value": parValue, "_id": str(jobID) + str(parName) + str(parValue)}
146147
for parName, parValue in parameters
147148
]
148149

0 commit comments

Comments
 (0)