diff --git a/core/core.js b/core/core.js index 203c14b2..61516e90 100644 --- a/core/core.js +++ b/core/core.js @@ -3,7 +3,6 @@ import * as auth from './auth.js'; import * as form from './form.js'; import * as http from './http.js'; -let gProcessIndex = 0; let gProcesses = {}; let gStatsTimer = false; @@ -125,8 +124,7 @@ function invoke(handlers, argv) { function broadcastEvent(eventName, argv) { let promises = []; - for (let i in gProcesses) { - let process = gProcesses[i]; + for (let process of Object.values(gProcesses)) { if (process.eventHandlers[eventName]) { promises.push(invoke(process.eventHandlers[eventName], argv)); } @@ -137,8 +135,7 @@ function broadcastEvent(eventName, argv) { function broadcast(message) { let sender = this; let promises = []; - for (let i in gProcesses) { - let process = gProcesses[i]; + for (let process of Object.values(gProcesses)) { if (process != sender && process.packageOwner == sender.packageOwner && process.packageName == sender.packageName) { @@ -151,9 +148,7 @@ function broadcast(message) { function getUser(caller, process) { return { - name: process.userName, key: process.key, - index: process.index, packageOwner: process.packageOwner, packageName: process.packageName, credentials: process.credentials, @@ -208,8 +203,6 @@ async function getProcessBlob(blobId, key, options) { print("Creating task for " + blobId + " " + key); process = {}; process.key = key; - process.index = gProcessIndex++; - process.userName = 'user' + process.index; process.credentials = options.credentials || {}; process.task = new Task(); process.eventHandlers = {};