Updated to not set host if it's not in config file.

This commit is contained in:
Travis
2013-02-17 19:35:02 -08:00
parent 0854996cdd
commit 712b0506c5
2 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"iron": {
"host": "staging-cache.iron.io",
"cache_host": "staging-cache.iron.io",
"project_id": "510d3381c2e603648d0005f5",
"token": "liILas32ParkPtDfK9ztjWP_RI0",
"super_token": "Lfvq3ev2DfyRebBn07hXZEvH3pQ",

View File

@@ -34,7 +34,7 @@ var config struct {
Token string `json:"token"`
ProjectId string `json:"project_id"`
SuperToken string `json:"super_token"`
Host string `json:"host"`
CacheHost string `json:"cache_host"`
WorkerHost string `json:"worker_host"`
} `json:"iron"`
MongoAuth common.MongoConfig `json:"mongo_auth"`
@@ -109,11 +109,14 @@ func main() {
}
ironAuth = common.NewIronAuth(session, config.MongoAuth.Database)
icache.Settings.UseConfigMap(map[string]interface{}{
cacheConfigMap := map[string]interface{}{
"token": config.Iron.Token,
"project_id": config.Iron.ProjectId,
"host": config.Iron.Host,
})
}
if config.Iron.CacheHost != "" {
cacheConfigMap["host"] = config.Iron.CacheHost
}
icache.Settings.UseConfigMap(cacheConfigMap)
r := mux.NewRouter()