wildcard-domain-finder-plus 1.0.4 → 1.0.6

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/app.js CHANGED
@@ -386,8 +386,8 @@ async function run() {
386
386
 
387
387
  let active = 0;
388
388
  const tasks = [];
389
- let lastProgressUpdate = 0;
390
389
  let done = false;
390
+ let lastHeartbeat = 0;
391
391
 
392
392
  async function scheduleNext() {
393
393
  if (quitting || done) return;
@@ -419,12 +419,6 @@ async function run() {
419
419
  } else if (res.error) {
420
420
  stats.errors++;
421
421
  }
422
-
423
- const now = Date.now();
424
- if (now - lastProgressUpdate > 500 || (done && active === 0)) {
425
- lastProgressUpdate = now;
426
- displayProgress(stats);
427
- }
428
422
  })().finally(() => {
429
423
  active--;
430
424
  });
@@ -434,6 +428,14 @@ async function run() {
434
428
  }
435
429
 
436
430
  while (!done || active > 0) {
431
+ const now = Date.now();
432
+
433
+ // Heartbeat refresh every 250ms
434
+ if (now - lastHeartbeat > 250) {
435
+ lastHeartbeat = now;
436
+ displayProgress(stats);
437
+ }
438
+
437
439
  if (quitting && active === 0) break;
438
440
  if (!paused) {
439
441
  await scheduleNext();
@@ -470,4 +472,5 @@ async function run() {
470
472
 
471
473
  run().catch(err => {
472
474
  console.error('Fatal error:', err);
473
- process
475
+ process.exit(1);
476
+ });