mirror of
https://github.com/elyby/chrly.git
synced 2024-11-30 02:32:19 +05:30
Переименованы некоторые параметры для statsd
This commit is contained in:
parent
445bd18fbc
commit
c74151c558
@ -62,16 +62,16 @@ func (s *SkinItem) Delete() {
|
||||
|
||||
func FindSkinByUsername(username string) (SkinItem, error) {
|
||||
var record SkinItem;
|
||||
services.Logger.IncCounter("skins.storage.query", 1)
|
||||
services.Logger.IncCounter("storage.query", 1)
|
||||
response := services.RedisPool.Cmd("GET", tools.BuildKey(username));
|
||||
if (response.IsType(redis.Nil)) {
|
||||
services.Logger.IncCounter("skins.storage.not_found", 1)
|
||||
services.Logger.IncCounter("storage.not_found", 1)
|
||||
return record, SkinNotFound{username}
|
||||
}
|
||||
|
||||
result, err := response.Str()
|
||||
if (err == nil) {
|
||||
services.Logger.IncCounter("skins.storage.found", 1)
|
||||
services.Logger.IncCounter("storage.found", 1)
|
||||
decodeErr := json.Unmarshal([]byte(result), &record)
|
||||
if (decodeErr != nil) {
|
||||
log.Println("Cannot decode record data")
|
||||
|
@ -27,7 +27,7 @@ func Cape(response http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
func CapeGET(w http.ResponseWriter, r *http.Request) {
|
||||
services.Logger.IncCounter("capes.get-request", 1)
|
||||
services.Logger.IncCounter("capes.get_request", 1)
|
||||
username := r.URL.Query().Get("name")
|
||||
if username == "" {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
@ -26,7 +26,7 @@ func Skin(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func SkinGET(w http.ResponseWriter, r *http.Request) {
|
||||
services.Logger.IncCounter("skins.get-request", 1)
|
||||
services.Logger.IncCounter("skins.get_request", 1)
|
||||
username := r.URL.Query().Get("name")
|
||||
if username == "" {
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
|
Loading…
Reference in New Issue
Block a user