From 2d37a501d862aded4db1f78eff37fa1eb579dced Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 16 Nov 2024 14:48:34 +0800 Subject: [PATCH] 1 --- server/wheelserver/service/log.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/server/wheelserver/service/log.go b/server/wheelserver/service/log.go index f1167b3b..10d4613a 100644 --- a/server/wheelserver/service/log.go +++ b/server/wheelserver/service/log.go @@ -1,17 +1,37 @@ package service import ( + "q5" ) -type log struct { +type logNode struct { + accountId string + logType string + subLogType string + currTime int64 + params map[string]string + entry q5.ListHead +} +type log struct { + logQueue q5.Queue } func (this *log) init() { + this.logQueue.Init() } func (this *log) unInit() { } -func (this *log) AddLog(accountId string, logType string, subType string, params map[string]string) { +func (this *log) AddAsyncLog(accountId string, logType string, subLogType string, currTime int64, + params map[string]string) { + node := new(logNode) + node.accountId = accountId + node.logType = logType + node.subLogType = subLogType + node.currTime = currTime + node.params = params + node.entry.Init(node) + this.logQueue.Push(&node.entry) }