mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-02 22:10:26 +08:00
删除不过期IP时不立即删除,以等待节点完成同步
This commit is contained in:
@@ -518,7 +518,7 @@ func (this *IPItemDAO) UpdateItemsRead(tx *dbs.Tx) error {
|
|||||||
func (this *IPItemDAO) CleanExpiredIPItems(tx *dbs.Tx) error {
|
func (this *IPItemDAO) CleanExpiredIPItems(tx *dbs.Tx) error {
|
||||||
// 删除 N 天之前过期的数据
|
// 删除 N 天之前过期的数据
|
||||||
_, err := this.Query(tx).
|
_, err := this.Query(tx).
|
||||||
Where("expiredAt<=:timestamp").
|
Where("(createdAt<=:timestamp AND updatedAt<=:timestamp)").
|
||||||
State(IPItemStateDisabled).
|
State(IPItemStateDisabled).
|
||||||
Param("timestamp", time.Now().Unix()-7*86400). // N 天之前过期的
|
Param("timestamp", time.Now().Unix()-7*86400). // N 天之前过期的
|
||||||
Limit(10000). // 限制条数,防止数量过多导致超时
|
Limit(10000). // 限制条数,防止数量过多导致超时
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user