Skip to content

Commit

Permalink
fix: getTasksToSubmit consider tasks inserted by 30 seconds or more
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Oct 30, 2024
1 parent 53c67a7 commit 111f2ca
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
""" Service for interacting with TransformationDB
"""

import datetime

from DIRAC import S_OK, S_ERROR
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.Core.Security.Properties import SecurityProperty
Expand Down Expand Up @@ -400,8 +402,10 @@ def export_getTasksToSubmit(self, transName, numTasks, site=""):
return res
transDict = res["Value"]
submitDict = {}
# applying few seconds delay to avoid race conditions
older = datetime.datetime.now() - datetime.timedelta(seconds=30)
res = self.transformationDB.getTasksForSubmission(
transName, numTasks=numTasks, site=site, statusList=["Created"]
transName, numTasks=numTasks, site=site, statusList=["Created"], older=older
)
if not res["OK"]:
return res
Expand Down

0 comments on commit 111f2ca

Please sign in to comment.