1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Workaround a race condition on meshagent sending coreinfo messages.

This commit is contained in:
Ylian Saint-Hilaire 2018-11-25 12:59:42 -08:00
parent de486bb02a
commit b2d9dc5f87
5 changed files with 57 additions and 59 deletions

View file

@ -602,7 +602,7 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
if (mesh == null) return;
// Get the node and change it if needed
obj.db.Get(obj.dbNodeKey, function (err, nodes) {
obj.db.Get(obj.dbNodeKey, function (err, nodes) { // TODO: THIS IS A BIG RACE CONDITION HERE, WE NEED TO FIX THAT. If this call is made twice at the same time on the same device, data will be missed.
if (nodes.length != 1) return;
var device = nodes[0];
if (device.agent) {