Improved node color calculation and increased log query interval in server.js.

This commit is contained in:
Benjamin Arntzen (aider)
2024-06-27 07:57:58 +01:00
parent a6b1dd1c40
commit 08bedb80a4
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -92,7 +92,8 @@ socket.addEventListener('message', (event) => {
// Update node color
const node = nodes.get(peerId);
if (node) {
const colorHex = '#' + (parseInt(msg_hash.slice(2), 16) % 0xFFFFFF).toString(16).padStart(6, '0');
const colorInt = parseInt(msg_hash.slice(2), 16);
const colorHex = '#' + (colorInt % 0xFFFFFF).toString(16).padStart(6, '0');
nodes.update({
id: peerId,
color: {
+2 -2
View File
@@ -57,7 +57,7 @@ setInterval(async () => {
} else {
console.log('debugMode is false');
const query = 'query=_time:2s relay received';
const query = 'query=_time:5s relay received';
console.log('Sending request to API');
try {
@@ -92,7 +92,7 @@ setInterval(async () => {
console.error('Logs is not an array:', logs);
}
}
}, 1000);
}, 3000);
server.listen(3000, () => {
console.log('Server is listening on port 3000');