[backend/api] Flush StreamWriter when exporting notes to drive file

This commit is contained in:
pancakes 2025-03-13 11:39:57 +10:00 committed by Iceshrimp development
parent 9d4d4a027e
commit d01af426db

View file

@ -426,9 +426,10 @@ public class BackgroundTaskQueue(int parallelism)
}; };
var stream = new MemoryStream(); var stream = new MemoryStream();
await using var sr = new StreamWriter(stream); await using var sw = new StreamWriter(stream);
await sr.WriteAsync(JsonSerializer.Serialize(notes, JsonSerialization.Options)); await sw.WriteAsync(JsonSerializer.Serialize(notes, JsonSerialization.Options));
await sw.FlushAsync(token);
await driveSvc.StoreFileAsync(stream, user, request, true); await driveSvc.StoreFileAsync(stream, user, request, true);