Updates to delete any existing archived configs during update process to prevent name conflicts

This commit is contained in:
Neil Dorin
2019-03-15 12:16:01 -06:00
parent 90bbd65fdc
commit 6235b44d89
3 changed files with 17 additions and 4 deletions

View File

@@ -34,7 +34,17 @@ namespace PepperDash.Essentials.AppServer.Messengers
void GetConfigFile(string url)
{
url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
try
{
var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url);
}
catch
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data");
url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid);
}
ConfigUpdater.GetConfigFromServer(url);
}

View File

@@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <param name="e"></param>
void ProgramInfoChanged(object sender, ProgramInfoEventArgs e)
{
Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
PostStatusMessage(e.ProgramInfo);
if (e.ProgramInfo != null)
{
//Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString());
PostStatusMessage(e.ProgramInfo);
}
}
/// <summary>