mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-25 00:10:26 +08:00
删除过期IP时增加条数限制,防止超时
This commit is contained in:
@@ -296,6 +296,7 @@ func (this *IPItemDAO) ListIPItemsAfterVersion(tx *dbs.Tx, version int64, size i
|
|||||||
Where("(expiredAt>0 AND expiredAt<=:timestamp)").
|
Where("(expiredAt>0 AND expiredAt<=:timestamp)").
|
||||||
State(IPItemStateDisabled).
|
State(IPItemStateDisabled).
|
||||||
Param("timestamp", time.Now().Unix()-7*86400). // N 天之前过期的
|
Param("timestamp", time.Now().Unix()-7*86400). // N 天之前过期的
|
||||||
|
Limit(10000). // 限制条数,防止数量过多导致超时
|
||||||
Delete()
|
Delete()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user