mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-11 09:59:59 +08:00
HEDNS: Adopt diff2 in compatibility mode (#1887)
This commit is contained in:
parent
e0fef398be
commit
f8fd853a02
1 changed files with 43 additions and 44 deletions
|
@ -205,10 +205,14 @@ func (c *hednsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models
|
|||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
||||
|
||||
var corrections []*models.Correction
|
||||
if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
|
||||
|
||||
var toCreate, toDelete, toModify diff.Changeset
|
||||
if !diff2.EnableDiff2 {
|
||||
differ := diff.New(dc)
|
||||
_, toCreate, toDelete, toModify, err := differ.IncrementalDiff(prunedRecords)
|
||||
_, toCreate, toDelete, toModify, err = differ.IncrementalDiff(prunedRecords)
|
||||
} else {
|
||||
differ := diff.NewCompat(dc)
|
||||
_, toCreate, toDelete, toModify, err = differ.IncrementalDiff(prunedRecords)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -248,11 +252,6 @@ func (c *hednsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*models
|
|||
})
|
||||
}
|
||||
|
||||
return corrections, err
|
||||
}
|
||||
|
||||
// Insert Future diff2 version here.
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue