mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "cmd/devp2p: make crawler-route53-updater less verbose (#27116)"
This reverts commit 758e98b9a9.
This commit is contained in:
parent
c342730561
commit
60593f4be9
2 changed files with 5 additions and 21 deletions
|
|
@ -144,7 +144,7 @@ func (c *cloudflareClient) uploadRecords(name string, records map[string]string)
|
||||||
_, err = c.CreateDNSRecord(context.Background(), c.zoneID, record)
|
_, err = c.CreateDNSRecord(context.Background(), c.zoneID, record)
|
||||||
} else if old.Content != val {
|
} else if old.Content != val {
|
||||||
// Entry already exists, only change its content.
|
// Entry already exists, only change its content.
|
||||||
log.Info(fmt.Sprintf("Updating %s from %q to %q", path, old.Content, val))
|
log.Debug(fmt.Sprintf("Updating %s from %q to %q", path, old.Content, val))
|
||||||
updated++
|
updated++
|
||||||
old.Content = val
|
old.Content = val
|
||||||
err = c.UpdateDNSRecord(context.Background(), c.zoneID, old.ID, old)
|
err = c.UpdateDNSRecord(context.Background(), c.zoneID, old.ID, old)
|
||||||
|
|
|
||||||
|
|
@ -221,13 +221,7 @@ func (c *route53Client) computeChanges(name string, records map[string]string, e
|
||||||
}
|
}
|
||||||
records = lrecords
|
records = lrecords
|
||||||
|
|
||||||
var (
|
var changes []types.Change
|
||||||
changes []types.Change
|
|
||||||
inserts int
|
|
||||||
upserts int
|
|
||||||
skips int
|
|
||||||
)
|
|
||||||
|
|
||||||
for path, newValue := range records {
|
for path, newValue := range records {
|
||||||
prevRecords, exists := existing[path]
|
prevRecords, exists := existing[path]
|
||||||
prevValue := strings.Join(prevRecords.values, "")
|
prevValue := strings.Join(prevRecords.values, "")
|
||||||
|
|
@ -243,30 +237,20 @@ func (c *route53Client) computeChanges(name string, records map[string]string, e
|
||||||
|
|
||||||
if !exists {
|
if !exists {
|
||||||
// Entry is unknown, push a new one
|
// Entry is unknown, push a new one
|
||||||
log.Debug(fmt.Sprintf("Creating %s = %s", path, newValue))
|
log.Info(fmt.Sprintf("Creating %s = %s", path, newValue))
|
||||||
changes = append(changes, newTXTChange("CREATE", path, ttl, newValue))
|
changes = append(changes, newTXTChange("CREATE", path, ttl, newValue))
|
||||||
inserts++
|
|
||||||
} else if prevValue != newValue || prevRecords.ttl != ttl {
|
} else if prevValue != newValue || prevRecords.ttl != ttl {
|
||||||
// Entry already exists, only change its content.
|
// Entry already exists, only change its content.
|
||||||
log.Info(fmt.Sprintf("Updating %s from %s to %s", path, prevValue, newValue))
|
log.Info(fmt.Sprintf("Updating %s from %s to %s", path, prevValue, newValue))
|
||||||
changes = append(changes, newTXTChange("UPSERT", path, ttl, newValue))
|
changes = append(changes, newTXTChange("UPSERT", path, ttl, newValue))
|
||||||
upserts++
|
|
||||||
} else {
|
} else {
|
||||||
log.Debug(fmt.Sprintf("Skipping %s = %s", path, newValue))
|
log.Debug(fmt.Sprintf("Skipping %s = %s", path, newValue))
|
||||||
skips++
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate over the old records and delete anything stale.
|
// Iterate over the old records and delete anything stale.
|
||||||
deletions := makeDeletionChanges(existing, records)
|
changes = append(changes, makeDeletionChanges(existing, records)...)
|
||||||
changes = append(changes, deletions...)
|
|
||||||
|
|
||||||
log.Info("Computed DNS changes",
|
|
||||||
"changes", len(changes),
|
|
||||||
"inserts", inserts,
|
|
||||||
"skips", skips,
|
|
||||||
"deleted", len(deletions),
|
|
||||||
"upserts", upserts)
|
|
||||||
// Ensure changes are in the correct order.
|
// Ensure changes are in the correct order.
|
||||||
sortChanges(changes)
|
sortChanges(changes)
|
||||||
return changes
|
return changes
|
||||||
|
|
@ -279,7 +263,7 @@ func makeDeletionChanges(records map[string]recordSet, keep map[string]string) [
|
||||||
if _, ok := keep[path]; ok {
|
if _, ok := keep[path]; ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Debug(fmt.Sprintf("Deleting %s = %s", path, strings.Join(set.values, "")))
|
log.Info(fmt.Sprintf("Deleting %s = %s", path, strings.Join(set.values, "")))
|
||||||
changes = append(changes, newTXTChange("DELETE", path, set.ttl, set.values...))
|
changes = append(changes, newTXTChange("DELETE", path, set.ttl, set.values...))
|
||||||
}
|
}
|
||||||
return changes
|
return changes
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue