mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-21 23:53:55 +02:00
Ingest schedule (#391)
Includes a new "app" running the ingestion jobs (aka fetch_news and find_missing_companies + enrich_company_financials) on a schedule. This also fixes an issue with the previous schedule implementation by persisting the schedule in a file that survives new deployment and continues where it left off.
This commit is contained in:
@ -62,9 +62,7 @@ def test_schedule(
|
||||
mock_handelsblatt_rss.return_value = Mock(
|
||||
get_news_for_category=Mock(return_value=mock_news_handelsblatt)
|
||||
)
|
||||
assert fetch_news.schedule(Mock()) == len(
|
||||
mock_news_handelsblatt + mock_news_tagesschau
|
||||
)
|
||||
assert fetch_news.main(Mock()) == len(mock_news_handelsblatt + mock_news_tagesschau)
|
||||
|
||||
|
||||
@patch("aki_prj23_transparenzregister.apps.fetch_news.MongoNewsService")
|
||||
@ -90,4 +88,4 @@ def test_schedule_error(
|
||||
mock_handelsblatt_rss.return_value = Mock(
|
||||
get_news_for_category=Mock(return_value=mock_news_handelsblatt)
|
||||
)
|
||||
assert fetch_news.schedule(Mock()) == 0
|
||||
assert fetch_news.main(Mock()) == 0
|
||||
|
Reference in New Issue
Block a user