mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
DNS解析发生变化时立即触发同步任务
This commit is contained in:
@@ -39,7 +39,13 @@ func NewDNSTaskExecutor(duration time.Duration) *DNSTaskExecutor {
|
||||
}
|
||||
|
||||
func (this *DNSTaskExecutor) Start() {
|
||||
for range this.ticker.C {
|
||||
for {
|
||||
select {
|
||||
case <-this.ticker.C:
|
||||
case <-dnsmodels.DNSTasksNotifier:
|
||||
time.Sleep(3 * time.Second) // 人为延长N秒,等待可能的几个任务合并
|
||||
}
|
||||
|
||||
err := this.Loop()
|
||||
if err != nil {
|
||||
this.logErr("DNSTaskExecutor", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user