removed debug code

This commit is contained in:
Dmitri 2026-04-09 11:01:47 +04:00
parent 8287ed0aab
commit 62b9b3ceb9

View File

@ -226,21 +226,9 @@ class DownloadManagerClass {
* Process the download queue
*/
private async processQueue(): Promise<void> {
if (this.isProcessing || this.isPaused) {
logger.info('[DownloadManager] processQueue skipped', {
isProcessing: this.isProcessing,
isPaused: this.isPaused,
});
return;
}
if (this.isProcessing || this.isPaused) return;
if (this.queue.length === 0 && this.activeDownloads.size === 0) return;
logger.info('[DownloadManager] processQueue starting', {
queueLength: this.queue.length,
activeDownloads: this.activeDownloads.size,
maxConcurrent: this.config.maxConcurrent,
});
this.isProcessing = true;
while (
@ -251,11 +239,6 @@ class DownloadManagerClass {
const job = this.queue.shift();
if (!job) break;
logger.info('[DownloadManager] Starting download', {
storageKey: job.storageKey.slice(-50),
url: job.url.slice(0, 80),
});
this.activeDownloads.set(job.url, job);
this.downloadAsset(job);
}
@ -289,22 +272,11 @@ class DownloadManagerClass {
});
}
logger.info('[DownloadManager] Fetching', {
url: job.url.slice(0, 100),
hasRangeHeader: !!headers['Range'],
});
const response = await fetch(job.url, {
signal: job.abortController.signal,
headers,
});
logger.info('[DownloadManager] Fetch response', {
status: response.status,
ok: response.ok,
contentLength: response.headers.get('content-length'),
});
// Accept both 200 OK and 206 Partial Content
if (!response.ok && response.status !== 206) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
@ -422,12 +394,6 @@ class DownloadManagerClass {
await OfflineDbManager.removeFromQueue(job.id);
}
logger.info('[DownloadManager] Download complete', {
storageKey: job.storageKey.slice(-50),
bytesLoaded: job.bytesLoaded,
isPartial: job.isPartial,
});
downloadEventBus.emitPreloadComplete({
jobId: job.id,
assetId: job.assetId,