From 9340908fe6c729e56ea5c7207a137d5daf0108be Mon Sep 17 00:00:00 2001 From: Benjamin Date: Wed, 29 May 2019 17:33:10 +0200 Subject: [PATCH] [Currency support] Activate multi-currencies support (#894) This CL is the last piece to activate currency conversion support in PBS. It activates currency support per default. Currency rates will be fetched once per hour (PrebidJS file is updated once a day). Issue: #280 --- config/config.go | 2 +- config/config_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index b1516337d9e..563bee95388 100644 --- a/config/config.go +++ b/config/config.go @@ -600,7 +600,7 @@ func SetupViper(v *viper.Viper, filename string) { v.SetDefault("gdpr.timeouts_ms.init_vendorlist_fetches", 0) v.SetDefault("gdpr.timeouts_ms.active_vendorlist_fetch", 0) v.SetDefault("currency_converter.fetch_url", "https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json") - v.SetDefault("currency_converter.fetch_interval_seconds", 0) // #280 Not activated for the time being + v.SetDefault("currency_converter.fetch_interval_seconds", 1800) // fetch currency rates every 30 minutes v.SetDefault("default_request.type", "") v.SetDefault("default_request.file.name", "") v.SetDefault("default_request.alias_info", false) diff --git a/config/config_test.go b/config/config_test.go index 89cb7f8f203..b7254bc1a88 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -24,6 +24,8 @@ func TestDefaults(t *testing.T) { cmpInts(t, "host_cookie.ttl_days", int(cfg.HostCookie.TTL), 90) cmpStrings(t, "datacache.type", cfg.DataCache.Type, "dummy") cmpStrings(t, "adapters.pubmatic.endpoint", cfg.Adapters[string(openrtb_ext.BidderPubmatic)].Endpoint, "http://hbopenbid.pubmatic.com/translator?source=prebid-server") + cmpInts(t, "currency_converter.fetch_interval_seconds", cfg.CurrencyConverter.FetchIntervalSeconds, 1800) + cmpStrings(t, "currency_converter.fetch_url", cfg.CurrencyConverter.FetchURL, "https://cdn.jsdelivr.net/gh/prebid/currency-file@1/latest.json") } var fullConfig = []byte(`