round55: DNS-Abfragen mit Timeout absichern, Thread-Pool-Groesse erhoehen (behebt Haenger nach masscan/httpx-Vorabscan), Live-Haekchen pro fertigem Geraet im Batch

This commit is contained in:
2026-07-26 12:27:24 +02:00
parent c7398ce2ba
commit ca8c8c1d3b
3 changed files with 75 additions and 6 deletions

View File

@@ -372,7 +372,12 @@ export async function scanRoutes(app: FastifyInstance): Promise<void> {
break;
}
const batch = devices.slice(i, i + CONCURRENT_DEVICES);
updateJobProgress("devices", scannedCount, batch.map((d) => d.hostname).join(", "));
const stillRunning = new Set(batch.map((d) => d.hostname));
const renderBatchLabel = () =>
`${batch.map((d) => (stillRunning.has(d.hostname) ? d.hostname : `${d.hostname}`)).join(", ")}`;
updateJobProgress("devices", scannedCount, renderBatchLabel());
await Promise.all(
batch.map(async (device) => {
@@ -382,6 +387,7 @@ export async function scanRoutes(app: FastifyInstance): Promise<void> {
// Geräte-Seite) - überspringen statt zu überlappen, sonst
// könnten beide gleichzeitig denselben neuen Dienst anlegen
// wollen.
stillRunning.delete(device.hostname);
return;
}
try {
@@ -428,6 +434,15 @@ export async function scanRoutes(app: FastifyInstance): Promise<void> {
});
} finally {
unlockDevice(device.id);
// Live sichtbar machen, WELCHES Gerät im aktuellen Batch
// schon fertig ist ("✓ Name") und welche noch laufen -
// bisher aktualisierte sich die Anzeige erst wieder, wenn
// ALLE 10 Geräte des Batches fertig waren. Blieb eines davon
// hängen, sah der komplette Batch wie eingefroren aus, ohne
// erkennbar zu machen, WELCHES Gerät das eigentlich betraf
// (siehe Bugreport).
stillRunning.delete(device.hostname);
updateJobProgress("devices", scannedCount, renderBatchLabel());
}
})
);