Add async session save method, random tweaks

This commit is contained in:
John Gross
2017-02-06 01:22:35 -08:00
parent d5159dc72a
commit ff3cdfd099
6 changed files with 45 additions and 18 deletions

View File

@@ -39,9 +39,9 @@ namespace Torch.Server
return;
}
string configName = args.Length > 0 ? args[0] : "TorchConfig.xml";
var configName = args.FirstOrDefault() ?? "TorchConfig.xml";
var configPath = Path.Combine(Directory.GetCurrentDirectory(), configName);
var options = new ServerConfig("Torch");
ServerConfig options;
if (File.Exists(configName))
{
_log.Info($"Loading config {configPath}");
@@ -50,6 +50,7 @@ namespace Torch.Server
else
{
_log.Info($"Generating default config at {configPath}");
options = new ServerConfig();
options.SaveTo(configPath);
}