diff --git a/dataimporter/lib/view.py b/dataimporter/lib/view.py index d40782d..7d4a9bc 100644 --- a/dataimporter/lib/view.py +++ b/dataimporter/lib/view.py @@ -227,10 +227,8 @@ def iter_changed(self) -> Iterable[SourceRecord]: def flush(self): """ - Remove all expired embargo IDs from the embargo queue and remove all IDs from - the main view queue. + Remove all IDs from the main view queue. """ - self.embargoes.flush_released(now()) self.changes.clear() def rebuild(self): diff --git a/tests/test_view.py b/tests/test_view.py index 262de48..41c7d28 100644 --- a/tests/test_view.py +++ b/tests/test_view.py @@ -256,9 +256,7 @@ def test_iter_changed(self, view: View): def test_flush(self, view: View): records = [ - # use int_to_str to maintain the sort order - SourceRecord(i, {"a": i}, "test") - for i in sorted(map(str, range(100))) + SourceRecord(i, {"a": i}, "test") for i in sorted(map(str, range(100))) ] records.append(SourceRecord("100", {"NhmSecEmbargoDate": "2025-02-05"}, "test")) @@ -272,7 +270,7 @@ def test_flush(self, view: View): view.flush() assert view.count() == 0 - assert view.embargoes.size() == 0 + assert view.embargoes.size() == 1 @freeze_time("2024/10/16") def test_rebuild(self, view: View):