Compare commits

..

8 Commits
3.2.1 ... 3.2.4

Author SHA1 Message Date
ErickSkrauch
a661f9aac3 Merge branch 'develop' 2017-06-17 01:30:58 +03:00
ErickSkrauch
9ffdf99b77 Образ redis заменён на 3.2-32bit для экономии памяти 2017-06-17 01:17:02 +03:00
ErickSkrauch
ad35872fc1 Добавлено логирование запроса получения токена авторизации 2017-06-17 01:16:34 +03:00
ErickSkrauch
a8d8fffaa5 Исправлен адрес для API запросов 2017-06-17 01:16:08 +03:00
ErickSkrauch
0d41f0c347 Merge branch 'develop' 2017-04-13 14:20:36 +03:00
ErickSkrauch
b22f0551fa Не добавляем домен к ссылке на скин, если скин уже имеет домен 2017-04-13 14:20:04 +03:00
ErickSkrauch
1a906cfc09 Merge branch 'develop' 2017-04-10 20:50:25 +03:00
ErickSkrauch
f610667aa5 Revert statsd config 2017-04-10 20:47:45 +03:00
6 changed files with 20 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
version: '2'
services:
redis:
image: redis:3.0-alpine
image: redis:3.2-32bit
volumes:
- ./data/redis:/data

View File

@@ -5,7 +5,7 @@ import (
"net/http"
)
const domain = "https://dev.account.ely.by"
const domain = "https://account.ely.by"
var Client = &http.Client{}

View File

@@ -30,7 +30,12 @@ func BuildKey(username string) string {
}
func BuildElyUrl(route string) string {
return "http://ely.by" + route
prefix := "http://ely.by"
if !strings.HasPrefix(route, prefix) {
route = prefix + route
}
return route
}
func getCurrentHour() int64 {

View File

@@ -20,3 +20,13 @@ func TestBuildKey(t *testing.T) {
t.Error("Function shound convert string to lower case and concatenate it with usernmae:")
}
}
func TestBuildElyUrl(t *testing.T) {
if BuildElyUrl("/route") != "http://ely.by/route" {
t.Error("Function should add prefix to the provided relative url.")
}
if BuildElyUrl("http://ely.by/test/route") != "http://ely.by/test/route" {
t.Error("Function should do not add prefix to the provided prefixed url.")
}
}

View File

@@ -42,8 +42,10 @@ func _getByField(field string, value string) (accounts.AccountInfoResponse, erro
func getToken() (*accounts.Token, error) {
if token == nil {
println("token is nil, trying to obtain new one")
tempToken, err := accounts.GetToken(*AccountsTokenConfig)
if err != nil {
println("cannot obtain new one token", err)
return &accounts.Token{}, err
}

View File

@@ -77,7 +77,6 @@ func main() {
// statsd
var statsdString = os.Getenv("STATSD_ADDR")
statsdString = ""
if (statsdString != "") {
log.Println("Connecting to statsd")
hostname, _ := os.Hostname()