🐛 Fixes in track tasks

This commit is contained in:
2025-11-10 23:58:12 +08:00
parent db7d994039
commit 68cd23d64f
2 changed files with 30 additions and 34 deletions

View File

@@ -261,7 +261,7 @@ public class FileUploadController(
);
// Update task status to "processing" - background processing is now happening
await persistentTaskService.UpdateTaskProgressAsync(taskId, 95, "Processing file in background...");
await persistentTaskService.UpdateTaskProgressAsync(taskId, 0.95, "Processing file in background...");
// Send upload completion notification (file is uploaded, but processing continues)
await persistentTaskService.SendUploadCompletedNotificationAsync(persistentTask, fileId);
@@ -312,15 +312,13 @@ public class FileUploadController(
{
var chunkPath = Path.Combine(taskPath, i + ".chunk");
if (!System.IO.File.Exists(chunkPath))
{
throw new InvalidOperationException("Chunk " + i + " is missing.");
}
await using var chunkStream = new FileStream(chunkPath, FileMode.Open);
await chunkStream.CopyToAsync(mergedStream);
// Update progress after each chunk is merged
var currentProgress = baseProgress + (progressPerChunk * (i + 1));
var currentProgress = baseProgress + progressPerChunk * (i + 1);
await persistentTaskService.UpdateTaskProgressAsync(
taskId,
currentProgress,