dankgrinder 8.18.0 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/grinder.js +2 -10
- package/lib/rawLogger.js +12 -2
- package/package.json +1 -1
package/lib/grinder.js
CHANGED
|
@@ -2719,7 +2719,6 @@ async function start(apiKey, apiUrl, opts = {}) {
|
|
|
2719
2719
|
if (!isThisWorker && w.channel?.id !== channelId) continue;
|
|
2720
2720
|
|
|
2721
2721
|
if (event.type === 'death') {
|
|
2722
|
-
// Update worker's lifesaver count so dashboard ♥ updates in real time
|
|
2723
2722
|
if (event.lifesaversLeft >= 0) {
|
|
2724
2723
|
const prev = w._lifesavers;
|
|
2725
2724
|
w._lifesavers = event.lifesaversLeft;
|
|
@@ -2748,16 +2747,7 @@ async function start(apiKey, apiUrl, opts = {}) {
|
|
|
2748
2747
|
}
|
|
2749
2748
|
}
|
|
2750
2749
|
});
|
|
2751
|
-
checks.push(`${rgb(52, 211, 153)}✓${c.reset} ${c.white}RawLog${c.reset}`);
|
|
2752
2750
|
}
|
|
2753
|
-
if (hasZlib) checks.push(`${rgb(52, 211, 153)}✓${c.reset} ${c.white}zlib${c.reset}`);
|
|
2754
|
-
if (WEBHOOK_URL) checks.push(`${rgb(52, 211, 153)}✓${c.reset} ${c.white}Webhook${c.reset}`);
|
|
2755
|
-
if (CLUSTER_ENABLED) {
|
|
2756
|
-
checks.push(`${rgb(52, 211, 153)}✓${c.reset} ${rgb(34, 211, 238)}Cluster${c.reset} ${c.dim}(${NODE_ID.substring(0, 12)})${c.reset}`);
|
|
2757
|
-
}
|
|
2758
|
-
checks.push(`${rgb(52, 211, 153)}✓${c.reset} ${c.white}${accounts.length} Account${accounts.length > 1 ? 's' : ''}${c.reset}`);
|
|
2759
|
-
console.log(` ${checks.join(' ')}`);
|
|
2760
|
-
console.log('');
|
|
2761
2751
|
|
|
2762
2752
|
// ── Phase 1: Login ─────────────────────────────────────────────
|
|
2763
2753
|
const parsedGapMin = Number.parseInt(String(process.env.LOGIN_GAP_MIN_MS || '50'), 10);
|
|
@@ -2773,10 +2763,12 @@ async function start(apiKey, apiUrl, opts = {}) {
|
|
|
2773
2763
|
const batch = accounts.slice(i, Math.min(i + BATCH_SIZE, accounts.length));
|
|
2774
2764
|
await Promise.all(batch.map(async (acc, idx) => {
|
|
2775
2765
|
if (idx > 0) await new Promise(r => setTimeout(r, 100 + Math.floor(Math.random() * 500)));
|
|
2766
|
+
console.log(` [${i + idx + 1}] starting: ${acc.label || acc.id}`);
|
|
2776
2767
|
const worker = new AccountWorker(acc, i + idx);
|
|
2777
2768
|
workers.push(worker);
|
|
2778
2769
|
workerMap.set(acc.id, worker);
|
|
2779
2770
|
await worker.start();
|
|
2771
|
+
console.log(` [${i + idx + 1}] done: ${acc.label || acc.id}`);
|
|
2780
2772
|
if (worker._tokenInvalid) {
|
|
2781
2773
|
console.log(` [${i + idx + 1}] FAIL - invalid token: ${acc.label || acc.id}`);
|
|
2782
2774
|
} else if (worker.channel) {
|
package/lib/rawLogger.js
CHANGED
|
@@ -40,8 +40,14 @@ async function init(redisUrl) {
|
|
|
40
40
|
redis = new Redis(redisUrl, {
|
|
41
41
|
maxRetriesPerRequest: 2,
|
|
42
42
|
retryStrategy: (times) => times > 3 ? null : Math.min(times * 500, 3000),
|
|
43
|
-
lazyConnect:
|
|
43
|
+
lazyConnect: true,
|
|
44
44
|
});
|
|
45
|
+
// Skip if already connecting or connected
|
|
46
|
+
if (redis.status === 'connecting' || redis.status === 'connect' || redis.status === 'ready') {
|
|
47
|
+
console.log('[rawLogger] Redis already connecting — skipping');
|
|
48
|
+
redisReady = false;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
45
51
|
// Wait for actual connection before marking ready
|
|
46
52
|
await new Promise((resolve, reject) => {
|
|
47
53
|
const timeout = setTimeout(() => {
|
|
@@ -70,7 +76,11 @@ async function init(redisUrl) {
|
|
|
70
76
|
redisReady = true;
|
|
71
77
|
});
|
|
72
78
|
} catch (e) {
|
|
73
|
-
|
|
79
|
+
// Suppress "already connecting" errors — happens when Redis reconnects mid-init
|
|
80
|
+
const msg = e?.message || '';
|
|
81
|
+
if (!msg.includes('already connecting') && !msg.includes('already connected')) {
|
|
82
|
+
console.error(`[rawLogger] Redis connect failed: ${msg}`);
|
|
83
|
+
}
|
|
74
84
|
redis = null;
|
|
75
85
|
redisReady = false;
|
|
76
86
|
}
|