Skip to content

Commit

Permalink
Add await and change to asynchronous serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkuttappan committed Jul 16, 2024
1 parent 0e36767 commit 3aec3cb
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ static async Task HandlePackageFileParsing(Stream stream, FileInfo packageFilePa

await using FileStream gzipFileStream = new FileStream(gzipJsonTokenFilePath, FileMode.Create, FileAccess.Write);
await using GZipStream gZipStream = new GZipStream(gzipFileStream, CompressionLevel.Optimal);
JsonSerializer.Serialize(new Utf8JsonWriter(gZipStream, new JsonWriterOptions { Indented = false }), treeTokenCodeFile, options);
await Task.Delay(1000);
await JsonSerializer.SerializeAsync(gZipStream, treeTokenCodeFile, options);
Console.WriteLine($"TokenCodeFile File {gzipJsonTokenFilePath} Generated Successfully.");
Console.WriteLine();
}
Expand Down

0 comments on commit 3aec3cb

Please sign in to comment.