diff --git a/swh/lister/github/lister.py b/swh/lister/github/lister.py index 011ff3c04493f459caffb87f4cf87d3a7c4163b6..986f3d6d0995ac8b4dc7e2d9c721fc0c614f1f72 100644 --- a/swh/lister/github/lister.py +++ b/swh/lister/github/lister.py @@ -213,3 +213,10 @@ class GitHubLister(Lister[GitHubListerState, List[Dict[str, Any]]]): # the current run is higher than that stored in the database. if self.state.last_seen_id > scheduler_state.last_seen_id: self.updated = True + + def set_state_in_scheduler( + self, with_listing_finished_date: bool = False, force_state: bool = False + ) -> None: + # github range lister should not override shared incremental lister state + if not self.relisting: + super().set_state_in_scheduler(with_listing_finished_date, force_state) diff --git a/swh/lister/github/tests/test_lister.py b/swh/lister/github/tests/test_lister.py index ba7e37ea9988c18f54ccfa50e4c89295b7a7badf..20717fe696acec10f341788f011f2397d82fb5e5 100644 --- a/swh/lister/github/tests/test_lister.py +++ b/swh/lister/github/tests/test_lister.py @@ -135,6 +135,7 @@ def test_relister(swh_scheduler, caplog, requests_mocker) -> None: # Check that the relisting mode hasn't touched the stored state. lister_data = get_lister_data(swh_scheduler) assert lister_data.current_state == {"last_seen_id": 123} + assert lister_data.last_listing_finished_at is None def test_anonymous_ratelimit(