Enable/Disable fast restart plugin via config
Deleted legacy connection & heartbeat classes Hopefully fixed issues relating to certain web requests throwing recoverable error Modified Serializer class slightly
This commit is contained in:
@ -11,11 +11,6 @@ namespace SharedLibrary.Interfaces
|
||||
void Write();
|
||||
}
|
||||
|
||||
public class SerializeException : Exception
|
||||
{
|
||||
public SerializeException(string msg) : base(msg) { }
|
||||
}
|
||||
|
||||
public class Serialize<T> : ISerializable<T>
|
||||
{
|
||||
public static T Read(string filename)
|
||||
@ -28,7 +23,7 @@ namespace SharedLibrary.Interfaces
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SerializeException($"Could not desialize file {filename}: {e.Message}");
|
||||
throw new Exceptions.SerializeException($"Could not desialize file {filename}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,10 +37,24 @@ namespace SharedLibrary.Interfaces
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new SerializeException($"Could not serialize file {Filename()}: {e.Message}");
|
||||
throw new Exceptions.SerializeException($"Could not serialize file {Filename()}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string Filename() { return this.ToString(); }
|
||||
public static void Write(string filename, T data)
|
||||
{
|
||||
try
|
||||
{
|
||||
string configText = Newtonsoft.Json.JsonConvert.SerializeObject(data);
|
||||
File.WriteAllText(filename, configText);
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exceptions.SerializeException($"Could not serialize file {filename}: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string Filename() { return ToString(); }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user