The Free Software Media System - Server Backend & API
Use sync Serialize when writing scheduled tasks to disk
cvium42bcf171d982
diff --git a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.csindex a145a84237..3cc2cefb99 100644--- a/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs+++ b/Emby.Server.Implementations/ScheduledTasks/ScheduledTaskWorker.cs@@ -178,7 +178,8 @@ namespace Emby.Server.Implementations.ScheduledTaskslock (_lastExecutionResultSyncLock){using FileStream createStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);- JsonSerializer.SerializeAsync(createStream, value, _jsonOptions);+ using Utf8JsonWriter jsonStream = new Utf8JsonWriter(createStream);+ JsonSerializer.Serialize(jsonStream, value, _jsonOptions);}}}@@ -578,7 +579,8 @@ namespace Emby.Server.Implementations.ScheduledTasksDirectory.CreateDirectory(Path.GetDirectoryName(path));using FileStream createStream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);- JsonSerializer.SerializeAsync(createStream, triggers, _jsonOptions);+ using Utf8JsonWriter jsonWriter = new Utf8JsonWriter(createStream);+ JsonSerializer.Serialize(jsonWriter, triggers, _jsonOptions);}/// <summary>