Skip to content
Snippets Groups Projects
Commit 7cc37fa2 authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Refine scheduling policy for origins with no known last update

For origins that have never been visited, and for which we don't have a
queue position yet, we want to visit them in the order they've been
added.
parent 2efad289
No related branches found
No related tags found
1 merge request!253Refine scheduling policy for origins with no known last update
......@@ -429,7 +429,16 @@ class SchedulerBackend:
)
elif policy == "origins_without_last_update":
where_clauses.append("last_update IS NULL")
order_by = "origin_visit_stats.next_visit_queue_position nulls first"
order_by = ", ".join(
[
# By default, sort using the queue position. If the queue
# position is null, then the origin has never been visited,
# which we want to handle first
"origin_visit_stats.next_visit_queue_position nulls first",
# Schedule unknown origins in the order we've seen them
"listed_origins.first_seen",
]
)
# fmt: off
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment