Skip to content

Commit

Permalink
#387 move google ads dev token to appconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Sep 7, 2021
1 parent 2a9224d commit d14b1ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions server/appconfig/appconfig.go
Expand Up @@ -40,6 +40,8 @@ type AppConfig struct {

eventsConsumers []io.Closer
writeAheadLog io.Closer

GoogleAdsDeveloperToken string
}

var (
Expand Down Expand Up @@ -308,6 +310,8 @@ func Init(containerized bool, dockerHubID string) error {
appConfig.DisableSkipEventsWarn = viper.GetBool("server.disable_skip_events_warn")
appConfig.GlobalUniqueIDField = identifiers.NewUniqueID(uniqueIDField)

appConfig.GoogleAdsDeveloperToken = viper.GetString("google-ads.developer-token")

Instance = &appConfig
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions server/drivers/google_ads/google_ads.go
Expand Up @@ -6,9 +6,9 @@ import (
"encoding/json"
"fmt"
"github.com/iancoleman/strcase"
"github.com/jitsucom/jitsu/server/appconfig"
"github.com/jitsucom/jitsu/server/drivers/base"
"github.com/jitsucom/jitsu/server/httputils"
"github.com/spf13/viper"
"golang.org/x/oauth2/google"
"io"
"net/http"
Expand Down Expand Up @@ -198,7 +198,7 @@ func (g *GoogleAds) GetCollectionMetaKey() string {
func getDeveloperToken(config *GoogleAdsConfig) string {
developerToken := config.DeveloperToken
if developerToken == "" {
developerToken = viper.GetString("google-ads.developer-token")
developerToken = appconfig.Instance.GoogleAdsDeveloperToken
}
return developerToken
}
Expand Down

0 comments on commit d14b1ee

Please sign in to comment.