Developing lightweight computation at the DSG edge

Commit 3356bfed authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[monitor-assign] Update the globalAssign list less often



Since such an update rate is not really need it, do it less often
to try to avoid crashes in AntidoteDB's go client.

Also add some more verbosity.
Signed-off-by: Roger Pueyo Centelles's avatarRoger Pueyo Centelles <rpueyo@ac.upc.edu>
parent ee6b662f
......@@ -334,14 +334,13 @@ func sanitizeAssignationsInDatabase() {
fmt.Println("Sanitizing the assignation list...")
// Update the current monitors list
fmt.Println("Getting the current monitors list...")
currentMonitors := getCurrentMonitorsList()
// Update the current devices list
fmt.Println("Updating the current cnml...")
cnmlDevices = getCnmlDevicesList()
// Update the local copy of the global assignations list
updateGlobalAssignationList()
for _, v := range globalAssign {
// fmt.Println("############")
// fmt.Println(k, ": device ID:", v.Device.ID)
......@@ -381,11 +380,9 @@ func reassignDevs() {
// fmt.Println(localAssign)
// Update the CNML devices list from AntidoteDB
fmt.Println("Updating the current cnml...")
cnmlDevices = getCnmlDevicesList()
// Update the global assignations list from AntidoteDB
updateGlobalAssignationList()
// Update the local assignations list from AntidoteDB
updateLocalAssignationList()
......@@ -596,6 +593,8 @@ func startLocalAssignTimer() {
for range localAssignTicker.C {
registerMonitorInAntidote()
manageMonitorsList()
// Update the global assignations list from AntidoteDB
updateGlobalAssignationList()
sanitizeAssignationsInDatabase()
reassignDevs()
}
......
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