Compare commits
2 Commits
0b306221d4
...
0df8557f06
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0df8557f06 | ||
|
|
4575b5ac26 |
15
main.js
15
main.js
@ -32,10 +32,23 @@ const _sessionAccountOverrides = new Map(); // hoster -> account object
|
||||
// grepping account-rotation.log. Ring buffer per job keeps memory bounded.
|
||||
const _jobLogCollector = new Map(); // jobId -> Array<entry>
|
||||
const _MAX_LOG_ENTRIES_PER_JOB = 200;
|
||||
// Cap the total number of jobs we keep history for — without this the Map
|
||||
// keeps growing across batch-done boundaries (only start-upload clears it).
|
||||
// 1000 jobs × 200 entries × ~100 bytes ≈ 20 MB worst case, bounded.
|
||||
const _MAX_TRACKED_JOBS = 1000;
|
||||
function _appendJobLog(jobId, entry) {
|
||||
if (!jobId) return;
|
||||
let arr = _jobLogCollector.get(jobId);
|
||||
if (!arr) { arr = []; _jobLogCollector.set(jobId, arr); }
|
||||
if (!arr) {
|
||||
arr = [];
|
||||
_jobLogCollector.set(jobId, arr);
|
||||
// Evict oldest tracked job (insertion order) once we're past the cap.
|
||||
// Map iteration is insertion-ordered in spec, so .keys().next() is FIFO.
|
||||
if (_jobLogCollector.size > _MAX_TRACKED_JOBS) {
|
||||
const oldestId = _jobLogCollector.keys().next().value;
|
||||
if (oldestId !== undefined) _jobLogCollector.delete(oldestId);
|
||||
}
|
||||
}
|
||||
if (arr.length >= _MAX_LOG_ENTRIES_PER_JOB) arr.shift();
|
||||
arr.push(entry);
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "3.3.2",
|
||||
"version": "3.3.3",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
@ -4,12 +4,10 @@
|
||||
- ✅ 3.3.0 — Performance-Fixes (queue-cap, sort-throttle, history-delegation, recent-cap) + Log-Recovery
|
||||
- ✅ 3.3.1 — `removeFromQueueOnDone` coalesced via microtask (kein O(N²) mehr bei done-Bursts)
|
||||
- ✅ 3.3.2 — `fileuploader.log` Auto-Rotation bei 50 MB (max 3 Backups: .1 .2 .3)
|
||||
- ✅ 3.3.3 — `_jobLogCollector` Cap auf 1000 tracked jobs (FIFO-eviction beim Überschreiten)
|
||||
|
||||
## Open items (priorisiert)
|
||||
|
||||
### Stabilität
|
||||
- [ ] **`_jobLogCollector`** (main.js) — wird nur bei start-upload geleert, nicht bei batch-done. Bei vielen Batches ohne neuen start-upload wächst es. Cleanup bei batch-done für jobs die nicht mehr in queueJobs sind.
|
||||
|
||||
### Performance
|
||||
- [ ] **`applyQueueSelectionClasses`** (renderer/app.js:891) — `tbody.querySelectorAll` bei jedem Klick. Bei 5000-Jobs-Queue O(N) per click. Cache last rendered range.
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user