You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.2 KiB
36 lines
1.2 KiB
package service |
|
|
|
import ( |
|
"context" |
|
"time" |
|
|
|
"go-common/library/log" |
|
) |
|
|
|
func (s *Service) delArcEditHistory(limit int64) (delRows int64, err error) { |
|
var ( |
|
c = context.TODO() |
|
mtime = time.Now().Add(-2 * 30 * 24 * time.Hour) |
|
before = time.Date(mtime.Year(), mtime.Month(), mtime.Day(), mtime.Hour(), 0, 0, 0, mtime.Location()) |
|
) |
|
if delRows, err = s.arc.DelArcEditHistoryBefore(c, before, limit); err != nil { |
|
log.Error("s.arc.TxDelArcEditHistoryBefore(%s) error(%v)", mtime.Format("2006-01-02 15:04:05"), err) |
|
return |
|
} |
|
log.Info("delArchiveHistory before mtime(%s) rows(%d)", before.Format("2006-01-02 15:04:05"), delRows) |
|
return |
|
} |
|
|
|
func (s *Service) delArcVideoEditHistory(limit int64) (delRows int64, err error) { |
|
var ( |
|
c = context.TODO() |
|
mtime = time.Now().Add(-2 * 30 * 24 * time.Hour) |
|
before = time.Date(mtime.Year(), mtime.Month(), mtime.Day(), mtime.Hour(), 0, 0, 0, mtime.Location()) |
|
) |
|
if delRows, err = s.arc.DelArcVideoEditHistoryBefore(c, before, limit); err != nil { |
|
log.Error("s.arc.TxDelArcVideoEditHistoryBefore(%s) error(%v)", mtime.Format("2006-01-02 15:04:05"), err) |
|
return |
|
} |
|
log.Info("delArcVideoEditHistory before mtime(%s) rows(%d)", before.Format("2006-01-02 15:04:05"), delRows) |
|
return |
|
}
|
|
|