删除不过期IP时不立即删除,以等待节点完成同步

This commit is contained in:
GoEdgeLab
2022-05-21 22:06:04 +08:00
parent ee13b5be93
commit 8783896314
2 changed files with 2 additions and 2 deletions

View File

@@ -518,7 +518,7 @@ func (this *IPItemDAO) UpdateItemsRead(tx *dbs.Tx) error {
func (this *IPItemDAO) CleanExpiredIPItems(tx *dbs.Tx) error {
// 删除 N 天之前过期的数据
_, err := this.Query(tx).
Where("expiredAt<=:timestamp").
Where("(createdAt<=:timestamp AND updatedAt<=:timestamp)").
State(IPItemStateDisabled).
Param("timestamp", time.Now().Unix()-7*86400). // N 天之前过期的
Limit(10000). // 限制条数,防止数量过多导致超时

File diff suppressed because one or more lines are too long