From 4bc858a2159bc2c73033800a48381831f7a42276 Mon Sep 17 00:00:00 2001 From: Shivam Date: Sun, 17 May 2020 22:27:44 +0200 Subject: [PATCH] Force a read of the location file during detection --- osu.Game.Tournament/IPC/FileBasedIPC.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tournament/IPC/FileBasedIPC.cs b/osu.Game.Tournament/IPC/FileBasedIPC.cs index 321a4ad0aa..0454ef4e41 100644 --- a/osu.Game.Tournament/IPC/FileBasedIPC.cs +++ b/osu.Game.Tournament/IPC/FileBasedIPC.cs @@ -232,15 +232,17 @@ private string findFromEnvVar() private string findFromJsonConfig() { - try + Logger.Log("Trying to find stable through the json config"); + if (tournamentStorage.Exists(stable_config)) { - Logger.Log("Trying to find stable through the json config"); - return stableInfo.StablePath.Value; + using (Stream stream = tournamentStorage.GetStream(stable_config, FileAccess.Read, FileMode.Open)) + using (var sr = new StreamReader(stream)) + { + stableInfo = JsonConvert.DeserializeObject(sr.ReadToEnd()); + return stableInfo.StablePath.Value; + } } - catch - { - } - + return null; }