File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type OperationLogService struct{}
21
21
func (s OperationLogService ) SaveOperationLogChannel (olc <- chan * model.OperationLog ) {
22
22
// 只会在线程开启的时候执行一次
23
23
Logs := make ([]model.OperationLog , 0 )
24
- //5s 自动同步一次
24
+ // 5s 自动同步一次
25
25
duration := 5 * time .Second
26
26
timer := time .NewTimer (duration )
27
27
defer timer .Stop ()
@@ -35,7 +35,7 @@ func (s OperationLogService) SaveOperationLogChannel(olc <-chan *model.Operation
35
35
Logs = make ([]model.OperationLog , 0 )
36
36
timer .Reset (duration ) // 入库重置定时器
37
37
}
38
- case <- timer .C : //5s 自动同步一次
38
+ case <- timer .C : // 5s 自动同步一次
39
39
if len (Logs ) > 0 {
40
40
common .DB .Create (& Logs )
41
41
Logs = make ([]model.OperationLog , 0 )
@@ -102,5 +102,5 @@ func (s OperationLogService) Delete(operationLogIds []uint) error {
102
102
103
103
// Clean 清空日志
104
104
func (s OperationLogService ) Clean () error {
105
- return common .DB .Exec ("TRUNCATE TABLE operation_logs" ).Error
105
+ return common .DB .Exec ("DELETE FROM operation_logs" ).Error
106
106
}
You can’t perform that action at this time.
0 commit comments