Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 6460a27

Browse files
authored
Update variable names (#1296)
1 parent de2eae0 commit 6460a27

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

source/management_console/index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,7 @@ app.use('/console', express.static(__dirname + '/public'));
3030
const session = require('express-session');
3131
const {v4: uuidv4} = require('uuid');
3232

33-
function createRandomHex(num) {
34-
return crypto.randomBytes(num).toString('hex');
35-
}
36-
37-
app.use(session({
38-
secret: createRandomHex(32),
33+
const options = {
3934
name: 'owtserver',
4035
genid: function(req) {
4136
return uuidv4();
@@ -48,7 +43,10 @@ app.use(session({
4843
sameSite: true,
4944
maxAge: 600000
5045
}
51-
}));
46+
}
47+
Object.assign(options, {secret: crypto.randomBytes(32).toString('hex')});
48+
49+
app.use(session(options));
5250

5351
app.use((req, res, next) => {
5452
res.set('Cache-Control', 'no-store, no-cache');

source/stream_service/stateTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class WorkerNode {
6161
this.pubs = new Set();
6262
this.subs = new Set();
6363
this.procs = new Set();
64-
this.address = null;
64+
this.streamAddr = null;
6565
}
6666
isEmpty() {
6767
return this.pubs.size === 0 && this.subs.size === 0;
@@ -253,7 +253,7 @@ class SourceTrack {
253253
this.id = id;
254254
this.parent = parent;
255255
this.linkedSubs = new Set(); // Set {SubscriptionId}
256-
this.address = null; // Same as WokerNode's
256+
this.address = null; // Same as WokerNode's streamAddr
257257
}
258258
plain() {
259259
const plain = Object.assign({}, this);

source/stream_service/streamService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ function streamEngine(rpcClient) {
231231
if (!plainNode) {
232232
throw new Error('No node for internal address');
233233
}
234-
if (plainNode.address) {
235-
nodeAddress.set(nodeId, plainNode.address);
236-
return plainNode.address;
234+
if (plainNode.streamAddr) {
235+
nodeAddress.set(nodeId, plainNode.streamAddr);
236+
return plainNode.streamAddr;
237237
}
238238
const addr = await rpcChannel.makeRPC(
239239
nodeId, 'getInternalAddress', []);
240-
await stateStores.update('nodes', {id: nodeId}, {address: addr});
240+
await stateStores.update('nodes', {id: nodeId}, {streamAddr: addr});
241241
nodeAddress.set(nodeId, addr);
242242
return addr;
243243
};

0 commit comments

Comments
 (0)