From 2fe357ad9b96feccb3fb4b388f87cb64981da69c Mon Sep 17 00:00:00 2001 From: rex zhasm Date: Mon, 15 Apr 2019 15:24:10 +0800 Subject: [PATCH] =?UTF-8?q?Websockets=20=E4=B8=8D=E5=86=8D=E6=8B=89?= =?UTF-8?q?=E5=8F=96=20ActionLog=20=E7=9A=84=E6=B6=88=E6=81=AF=20(#398)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/logger/models/actionlog.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pkg/logger/models/actionlog.go b/pkg/logger/models/actionlog.go index a8e5a3351a..83da834b43 100644 --- a/pkg/logger/models/actionlog.go +++ b/pkg/logger/models/actionlog.go @@ -69,17 +69,19 @@ func (action *SActionlog) CustomizeCreate(ctx context.Context, userCred mcclient return nil } -func (manager *SActionlogManager) OnCreateComplete(ctx context.Context, items []db.IModel, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) { - actionLog := items[0].(*SActionlog) - if IsInActionWhiteList(actionLog.Action) { - select { - case logQueue <- actionLog: - return - default: - log.Warningf("Log queue full, insert failed, log ignored: %s", actionLog.Action) - } - } -} +// Websockets 不再拉取 ActionLog 的消息,因此注释掉如下代码 +// 可以保留,以便有需求时,再次打开 +// func (manager *SActionlogManager) OnCreateComplete(ctx context.Context, items []db.IModel, userCred mcclient.TokenCredential, query jsonutils.JSONObject, data jsonutils.JSONObject) { +// actionLog := items[0].(*SActionlog) +// if IsInActionWhiteList(actionLog.Action) { +// select { +// case logQueue <- actionLog: +// return +// default: +// log.Warningf("Log queue full, insert failed, log ignored: %s", actionLog.Action) +// } +// } +// } func StartNotifyToWebsocketWorker() { go func() {