域名解析任务可以使用集群ID筛选

This commit is contained in:
刘祥超
2021-09-21 10:56:53 +08:00
parent d4d7b1fff7
commit 67760a53ba
2 changed files with 11 additions and 7 deletions

View File

@@ -94,8 +94,12 @@ func (this *DNSTaskDAO) FindAllDoingTasks(tx *dbs.Tx) (result []*DNSTask, err er
}
// FindAllDoingOrErrorTasks 查找正在执行的和错误的任务
func (this *DNSTaskDAO) FindAllDoingOrErrorTasks(tx *dbs.Tx) (result []*DNSTask, err error) {
_, err = this.Query(tx).
func (this *DNSTaskDAO) FindAllDoingOrErrorTasks(tx *dbs.Tx, nodeClusterId int64) (result []*DNSTask, err error) {
var query = this.Query(tx)
if nodeClusterId > 0 {
query.Attr("clusterId", nodeClusterId)
}
_, err = query.
Where("(isDone=0 OR (isDone=1 AND isOk=0))").
AscPk().
Slice(&result).