diff --git a/src/raythena/actors/esworker.py b/src/raythena/actors/esworker.py index fe334f7..4361f36 100644 --- a/src/raythena/actors/esworker.py +++ b/src/raythena/actors/esworker.py @@ -193,6 +193,12 @@ def modify_job(self, job: PandaJob) -> PandaJob: else: cmd = f"{cmd} --jobNumber={job_number} " + maxEvents = min(500, job['nEventsPerInputFile']) + if "--maxEvents=" in cmd: + cmd = re.sub(r"--maxEvents=[0-9]+", f"--maxEvents={maxEvents}", cmd) + else: + cmd = f"{cmd} --maxEvents={maxEvents} " + job["jobPars"] = cmd return job