web/queue: remove final file from results without swapping for a dummy

This commit is contained in:
wukko
2025-05-24 14:27:30 +06:00
parent 9c16efd3b1
commit 2f6196f6e3
3 changed files with 9 additions and 11 deletions

View File

@@ -6,15 +6,11 @@ import { clearCurrentTasks, removeWorkerFromQueue } from "$lib/state/task-manage
import type { CobaltQueue, CobaltQueueItem, CobaltQueueItemRunning, UUID } from "$lib/types/queue";
export const DUMMY_FILE = new File([], 'pipeline_result_deleted.bin');
const clearPipelineCache = (queueItem: CobaltQueueItem) => {
if (queueItem.state === "running") {
for (const [ workerId, item ] of Object.entries(queueItem.pipelineResults)) {
if (item.name !== DUMMY_FILE.name) {
removeFromFileStorage(item.name);
queueItem.pipelineResults[workerId] = DUMMY_FILE;
}
removeFromFileStorage(item.name);
delete queueItem.pipelineResults[workerId];
}
} else if (queueItem.state === "done") {
removeFromFileStorage(queueItem.resultFile.name);