File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type OperationLogService struct{}
2121func (s OperationLogService ) SaveOperationLogChannel (olc <- chan * model.OperationLog ) {
2222 // 只会在线程开启的时候执行一次
2323 Logs := make ([]model.OperationLog , 0 )
24- //5s 自动同步一次
24+ // 5s 自动同步一次
2525 duration := 5 * time .Second
2626 timer := time .NewTimer (duration )
2727 defer timer .Stop ()
@@ -35,7 +35,7 @@ func (s OperationLogService) SaveOperationLogChannel(olc <-chan *model.Operation
3535 Logs = make ([]model.OperationLog , 0 )
3636 timer .Reset (duration ) // 入库重置定时器
3737 }
38- case <- timer .C : //5s 自动同步一次
38+ case <- timer .C : // 5s 自动同步一次
3939 if len (Logs ) > 0 {
4040 common .DB .Create (& Logs )
4141 Logs = make ([]model.OperationLog , 0 )
@@ -102,5 +102,5 @@ func (s OperationLogService) Delete(operationLogIds []uint) error {
102102
103103// Clean 清空日志
104104func (s OperationLogService ) Clean () error {
105- return common .DB .Exec ("TRUNCATE TABLE operation_logs" ).Error
105+ return common .DB .Exec ("DELETE FROM operation_logs" ).Error
106106}
You can’t perform that action at this time.
0 commit comments