Changeset View
Changeset View
Standalone View
Standalone View
swh/storage/cassandra/storage.py
Show First 20 Lines • Show All 1,213 Lines • ▼ Show 20 Lines | ) -> Optional[OriginVisit]: | ||||
continue | continue | ||||
if require_snapshot and updated_visit["snapshot"] is None: | if require_snapshot and updated_visit["snapshot"] is None: | ||||
continue | continue | ||||
# updated_visit is a candidate | # updated_visit is a candidate | ||||
if latest_visit is not None: | if latest_visit is not None: | ||||
if updated_visit["date"] < latest_visit["date"]: | if updated_visit["date"] < latest_visit["date"]: | ||||
continue | continue | ||||
if updated_visit["visit"] < latest_visit["visit"]: | assert ( | ||||
continue | updated_visit["visit"] >= latest_visit["visit"] | ||||
), "Cassandra returned visits not ordered by increasing visit id." | |||||
latest_visit = updated_visit | latest_visit = updated_visit | ||||
if latest_visit is None: | if latest_visit is None: | ||||
return None | return None | ||||
return OriginVisit( | return OriginVisit( | ||||
origin=latest_visit["origin"], | origin=latest_visit["origin"], | ||||
visit=latest_visit["visit"], | visit=latest_visit["visit"], | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |