Skip to content

Commit

Permalink
concurrency is tough!
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Aug 26, 2024
1 parent 05483a7 commit 814c1f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/controllers/systems.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async function load_systems(systemClients) {
//const results = await System.find({active: true}).catch( err => { // super simple query
console.error("Error - get_systems: " + err.message);
});
systemList = [];
tempList = [];
for (var result in results) {

var clientCount = 0;
Expand Down Expand Up @@ -137,8 +137,10 @@ async function load_systems(systemClients) {
system.screenName = null;
}*/
system.screenName = null;
systemList.push(system);
tempList.push(system);
}
// don't update the systemList until we have all the data or else load_systems will be called multiple times
systemList = tempList;
console.log("Loaded Systems: " + systemList.length + " that have been active since: " + fromDate);
}

Expand Down

0 comments on commit 814c1f6

Please sign in to comment.