MCPcopy Index your code
hub / github.com/TruthHun/BookStack / Add

Method Add

models/logs.go:50–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48}
49
50func (m *Logger) Add() error {
51 if m.MemberId <= 0 {
52 return errors.New("用户ID不能为空")
53 }
54 if m.Category == "" {
55 m.Category = "system"
56 }
57 if m.Content == "" {
58 return errors.New("日志内容不能为空")
59 }
60 loggerQueue.channel <- m
61 if atomic.LoadInt32(&(loggerQueue.isRunning)) <= 0 {
62 atomic.AddInt32(&(loggerQueue.isRunning), 1)
63 go addLoggerAsync()
64 }
65 return nil
66}
67
68func addLoggerAsync() {
69 defer atomic.AddInt32(&(loggerQueue.isRunning), -1)

Callers 15

ReadMethod · 0.45
FindPasswordMethod · 0.45
AdsMethod · 0.45
AddFriendlinkMethod · 0.45
ReadMethod · 0.45
GenerateMediaSignFunction · 0.45
AddMemberFunction · 0.45
initializationFunction · 0.45
IsContinuousSignMethod · 0.45
getWeekFunction · 0.45
getYearFunction · 0.45
getMonthFunction · 0.45

Calls 1

addLoggerAsyncFunction · 0.85

Tested by

no test coverage detected