Skip to content

Commit f638387

Browse files
authored
Feat: fix gh finding old runs (#269)
1 parent eb5642e commit f638387

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/discord-cluster-manager/launchers

src/discord-cluster-manager/launchers/github.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def run_submission(
6262
if gpu_vendor == "AMD":
6363
inputs["runner"] = runner_name
6464

65-
async with self.trigger_limit:
65+
async with self.trigger_limit: # DO NOT REMOVE, PREVENTS A RACE CONDITION
6666
if not await run.trigger(inputs):
6767
raise RuntimeError(
6868
"Failed to trigger GitHub Action. Please check the configuration."
@@ -197,7 +197,9 @@ async def trigger(self, inputs: dict) -> bool:
197197
logger.debug(
198198
f"Checking run {run.id} created at {run.created_at.isoformat()}"
199199
)
200-
if run.created_at.replace(tzinfo=datetime.timezone.utc) > trigger_time:
200+
if run.created_at.replace(
201+
tzinfo=datetime.timezone.utc
202+
) > trigger_time - datetime.timedelta(seconds=2):
201203
found_run = run
202204
logger.info(f"Found matching workflow run: ID {found_run.id}")
203205
break

0 commit comments

Comments
 (0)