mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 23:53:41 +08:00
chore: cache username
This commit is contained in:
@@ -41,9 +41,10 @@ func RecordLog(userId int, logType int, content string) {
|
||||
if logType == LogTypeConsume && !common.LogConsumeEnabled {
|
||||
return
|
||||
}
|
||||
username, _ := CacheGetUsername(userId)
|
||||
log := &Log{
|
||||
UserId: userId,
|
||||
Username: GetUsernameById(userId),
|
||||
Username: username,
|
||||
CreatedAt: common.GetTimestamp(),
|
||||
Type: logType,
|
||||
Content: content,
|
||||
@@ -59,7 +60,7 @@ func RecordConsumeLog(ctx context.Context, userId int, channelId int, promptToke
|
||||
if !common.LogConsumeEnabled {
|
||||
return
|
||||
}
|
||||
username := GetUsernameById(userId)
|
||||
username, _ := CacheGetUsername(userId)
|
||||
log := &Log{
|
||||
UserId: userId,
|
||||
Username: username,
|
||||
|
||||
Reference in New Issue
Block a user