alitheg commented on code in PR #529:
URL:
https://github.com/apache/tooling-trusted-releases/pull/529#discussion_r2694758014
##########
atr/worker.py:
##########
@@ -114,7 +114,12 @@ async def _task_next_claim() -> tuple[int, str, list[str]
| dict[str, Any]] | No
# Get the ID of the oldest queued task
oldest_queued_task = (
sqlmodel.select(sql.Task.id)
- .where(sql.Task.status == task.QUEUED)
+ .where(
+ sqlmodel.and_(
+ sql.Task.status == task.QUEUED,
+ sql.Task.added <= datetime.datetime.now(datetime.UTC)
- datetime.timedelta(seconds=2),
Review Comment:
It's a good question. As I wrote it I'm sure I had a scenario in mind where
with tasks scheduling themselves we wouldn't necessarily want a potentially
instant claim on them. But ever since (now but also when I committed it) I
can't think of how that could be a problem
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]