From 201a257d69e83c34e95b355d61c58df50ce29f1b Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 25 Mar 2017 15:54:17 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D1=8B=20Inc?= =?UTF-8?q?Counter=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D1=87=D0=B8=D0=BA=D0=BE=D0=B2=20=D0=B7=D0=B0=D0=B4?= =?UTF-8?q?=D0=B0=D1=87=20=D0=B8=D0=B7=20amqp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/worker/handlers.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/worker/handlers.go b/lib/worker/handlers.go index 3b0abaf..b573275 100644 --- a/lib/worker/handlers.go +++ b/lib/worker/handlers.go @@ -7,7 +7,7 @@ import ( func handleChangeUsername(model usernameChanged) (bool) { if (model.OldUsername == "") { - services.Logger.IncCounter("worker.change_username.empty_old_username") + services.Logger.IncCounter("worker.change_username.empty_old_username", 1) record := data.SkinItem{ UserId: model.AccountId, Username: model.NewUsername, @@ -20,7 +20,7 @@ func handleChangeUsername(model usernameChanged) (bool) { record, err := data.FindSkinByUsername(model.OldUsername) if (err != nil) { - services.Logger.IncCounter("worker.change_username.username_not_found") + services.Logger.IncCounter("worker.change_username.username_not_found", 1) // TODO: я не уверен, что это валидное поведение // Суть в том, что здесь может возникнуть ошибка в том случае, если записи в базе нету // а значит его нужно, как минимум, зарегистрировать @@ -30,7 +30,7 @@ func handleChangeUsername(model usernameChanged) (bool) { record.Username = model.NewUsername record.Save() - services.Logger.IncCounter("worker.change_username.processed") + services.Logger.IncCounter("worker.change_username.processed", 1) return true } @@ -38,7 +38,7 @@ func handleChangeUsername(model usernameChanged) (bool) { func handleSkinChanged(model skinChanged) (bool) { record, err := data.FindSkinById(model.AccountId) if (err != nil) { - services.Logger.IncCounter("worker.skin_changed.id_not_found") + services.Logger.IncCounter("worker.skin_changed.id_not_found", 1) return true } @@ -50,7 +50,7 @@ func handleSkinChanged(model skinChanged) (bool) { record.Save() - services.Logger.IncCounter("worker.skin_changed.processed") + services.Logger.IncCounter("worker.skin_changed.processed", 1) return true }