Developing lightweight computation at the DSG edge

Commit bc2d15b3 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[fetch] Print Antidote export process progress (II)



Also print on the terminal the addresses exported so far:

 302 devices exported to AntidoteDB (303 success, 0 fail)
 251 addresses exported to AntidoteDB (251 success, 0 fail)
Signed-off-by: default avatarRoger Pueyo Centelles <roger.pueyo@guifi.net>
parent d4d8ca43
......@@ -262,8 +262,8 @@ func main() {
// Export devices and their addresses to AntidoteDB
antidote_dev_succ := 0
antidote_dev_fail := 0
// antidote_add_succ := 0
// antidote_add_fail := 0
antidote_add_succ := 0
antidote_add_fail := 0
for k, v := range alldevices {
if saveDeviceToAntidote(v.ID) {
......@@ -272,9 +272,15 @@ func main() {
antidote_dev_fail++
}
for _, w := range v.Interfaces {
saveDeviceIpv4ToAntidote(v.ID, w.Ipv4)
if saveDeviceIpv4ToAntidote(v.ID, w.Ipv4) {
antidote_add_succ++
} else {
antidote_add_fail++
}
}
fmt.Printf("\r%d devices exported to AntidoteDB (%d success, %d fail)", k, antidote_dev_succ, antidote_dev_fail)
fmt.Printf("\033[1A\r%d devices exported to AntidoteDB (%d success, %d fail)\n", k, antidote_dev_succ, antidote_dev_fail)
fmt.Printf("%d addresses exported to AntidoteDB (%d success, %d fail)", antidote_add_succ+antidote_add_fail, antidote_add_succ, antidote_add_fail)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment