Skip to content

Commit

Permalink
feat: api query limit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtham1729 committed Dec 10, 2023
1 parent 197ba53 commit 89ca9b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion applications/data_fetcher/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
DB_PASSWORD = os.getenv("DB_PASSWORD", "postgres")

MARKETAUX_API_KEY = os.getenv("MARKETAUX_API_KEY", "demo")
MAX_API_QUERIES = 100


@dataclass
Expand Down Expand Up @@ -118,7 +119,7 @@ def fetch_news(self):
logger.info(f"Total News: {response_json['meta']['found']}")

while (
page < 25
page < MAX_API_QUERIES
and page
< response_json["meta"]["found"] // response_json["meta"]["limit"]
):
Expand Down

0 comments on commit 89ca9b7

Please sign in to comment.