Skip to content

Commit

Permalink
fix: Fixes race condition with world save snapshot request
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Feb 2, 2025
1 parent 019672b commit 6fee2e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Projects/Server/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,11 @@ public static void RunEventLoop()
DoKill(_restartOnKill);
}

// This is generally called from background threads during Preserialize
internal static void RequestSnapshot(string snapshotPath)
{
_performSnapshot = true;
_snapshotPath = snapshotPath;
_performSnapshot = true; // Set this after the path so race conditions do not occur
}

public static void VerifySerialization()
Expand Down

0 comments on commit 6fee2e3

Please sign in to comment.