this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Use crypto module for random index generation in queue shuffling

+2 -1
+2 -1
queue/queueManager.js
··· 2 2 const path = require('path'); 3 3 const cron = require('node-cron'); 4 4 const config = require('../config'); 5 + const crypto = require('crypto'); 5 6 6 7 class QueueManager { 7 8 constructor() { ··· 470 471 // Fisher-Yates (Knuth) shuffle algorithm 471 472 for (let i = queue.length - 1; i > 0; i--) { 472 473 // Generate random index between 0 and i (inclusive) 473 - const j = Math.floor(Math.random() * (i + 1)); 474 + const j = crypto.randomInt(0, i + 1); 474 475 // Swap elements at i and j 475 476 [queue[i], queue[j]] = [queue[j], queue[i]]; 476 477 }