From 10189913127eb8b2f803bfa4518ff707cd4fd108 Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Tue, 28 Jun 2016 21:39:38 +0800 Subject: [PATCH] print log if error occurs --- service/notification.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/service/notification.go b/service/notification.go index e72b134..ae3747b 100644 --- a/service/notification.go +++ b/service/notification.go @@ -69,7 +69,11 @@ func (n *NotificationHandler) Post() { user = "anonymous" } - go dao.AccessLog(user, project, repository, tag, action) + go func() { + if err := dao.AccessLog(user, project, repository, tag, action); err != nil { + log.Errorf("failed to add access log: %v", err) + } + }() if action == "push" || action == "delete" { go func() { if err := cache.RefreshCatalogCache(); err != nil {