pull one up
This commit is contained in:
parent
d74be13372
commit
aba2920a70
1 changed files with 12 additions and 14 deletions
|
|
@ -83,11 +83,20 @@ def run_get_rates(
|
||||||
|
|
||||||
process_state = GetRatesProcessState(ignore_warnings=ignore_warnings)
|
process_state = GetRatesProcessState(ignore_warnings=ignore_warnings)
|
||||||
|
|
||||||
|
if currencies:
|
||||||
|
currency_and_date_combinations = generate_currency_and_dates_combinations(
|
||||||
|
date_range=date_range, currencies=currencies
|
||||||
|
)
|
||||||
|
|
||||||
|
if pairs:
|
||||||
|
currency_and_date_combinations = generate_pairs_and_dates_combinations(
|
||||||
|
date_range=date_range, pairs=pairs
|
||||||
|
)
|
||||||
|
|
||||||
rates = obtain_rates_from_source(
|
rates = obtain_rates_from_source(
|
||||||
rates_source=rates_source,
|
rates_source=rates_source,
|
||||||
date_range=date_range,
|
date_range=date_range,
|
||||||
pairs=pairs,
|
currency_and_date_combinations=currency_and_date_combinations,
|
||||||
currencies=currencies,
|
|
||||||
ignore_warnings=ignore_warnings,
|
ignore_warnings=ignore_warnings,
|
||||||
)
|
)
|
||||||
logger.info("Rates obtained.")
|
logger.info("Rates obtained.")
|
||||||
|
|
@ -103,23 +112,12 @@ def obtain_rates_from_source(
|
||||||
rates_source: str,
|
rates_source: str,
|
||||||
date_range: DateRange,
|
date_range: DateRange,
|
||||||
ignore_warnings: bool,
|
ignore_warnings: bool,
|
||||||
currencies: Union[Set[Currency], None] = None,
|
currency_and_date_combinations,
|
||||||
pairs: Union[Set[CurrencyPair], None] = None,
|
|
||||||
) -> ExchangeRates:
|
) -> ExchangeRates:
|
||||||
rates_fetcher = build_rate_fetcher(
|
rates_fetcher = build_rate_fetcher(
|
||||||
rates_source=rates_source, rate_sources_mapping=RATES_SOURCES
|
rates_source=rates_source, rate_sources_mapping=RATES_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
if currencies:
|
|
||||||
currency_and_date_combinations = generate_currency_and_dates_combinations(
|
|
||||||
date_range=date_range, currencies=currencies
|
|
||||||
)
|
|
||||||
|
|
||||||
if pairs:
|
|
||||||
currency_and_date_combinations = generate_pairs_and_dates_combinations(
|
|
||||||
date_range=date_range, pairs=pairs
|
|
||||||
)
|
|
||||||
|
|
||||||
large_api_call_planned = (
|
large_api_call_planned = (
|
||||||
rates_fetcher.is_production_grade and len(currency_and_date_combinations) > 100
|
rates_fetcher.is_production_grade and len(currency_and_date_combinations) > 100
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue