mirror of
https://github.com/imputnet/cobalt.git
synced 2025-12-18 14:08:51 +00:00
web/queue: remove final file from results without swapping for a dummy
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user