diff --git a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs index 85941807..486b427d 100644 --- a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs @@ -26,7 +26,7 @@ public class ProfileDataService(ISptLogger logger, FileUtil value = jsonUtil.Deserialize(fileUtil.ReadFile($"{ProfileDataFilepath}{profileId}/{modKey}.json")); if (value != null) { - while (!_profileDataCache.TryAdd(profileDataKey, value)) { } + _profileDataCache[$"{profileId}:{modKey}"] = value; } } else @@ -48,8 +48,7 @@ public class ProfileDataService(ISptLogger logger, FileUtil throw new Exception("The profile data when serialized resulted in a null value"); } - while (!_profileDataCache.TryAdd($"{profileId}:{modKey}", profileData)) { } - + _profileDataCache[$"{profileId}:{modKey}"] = profileData; fileUtil.WriteFile($"{ProfileDataFilepath}{profileId}/{modKey}.json", data); } }