fix: Fixes race condition with world save snapshot request (#2104)
### Summary * Fixes a race condition where the snapshot path isn't between the request snapshot being set on a background thread, and the main loop consuming that flag. Closes #2102
This commit is contained in:
parent
019672b026
commit
717a1a062e
2 changed files with 7 additions and 1 deletions
|
|
@ -324,6 +324,11 @@ public static class World
|
|||
{
|
||||
_serializationStart = Core.Now;
|
||||
|
||||
if (string.IsNullOrEmpty(snapshotPath))
|
||||
{
|
||||
throw new ArgumentException("Snapshot path cannot be null or empty", nameof(snapshotPath));
|
||||
}
|
||||
|
||||
Persistence.SerializeAll();
|
||||
PauseSerializationThreads();
|
||||
EventSink.InvokeWorldSave();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue