merge origin/master but the merge seems to have gone poorly - will diff via github

This commit is contained in:
dovholuknf
2020-06-23 09:10:39 -04:00
3 changed files with 33 additions and 6 deletions
+21
View File
@@ -2,7 +2,28 @@
<configuration>
<appSettings>
<add key="UpdateUrl" value="https://netfoundry.jfrog.io/netfoundry/ziti-maven-snapshot/ziti-tunnel-win/amd64/windows/ziti-tunnel-win/maven-metadata.xml"/>
<!--
Format for UpdateTimer is "hours:minutes:seconds" - none of the values can exceed the normal range of each tuple.
For example this is invalid: "0:60:0" because 60 is > 59. To represent every hour you would use "1:0:0"
This example shows a value that would check for updates every one hour, two minutes and three seconds
<add key="UpdateTimer" value="1:2:3"/>
-->
<add key="UpdateTimer" value="0:0:5"/><!--default to verify the service is running every five seconds-->
<add key="Version" value="latest"/>
<!--
Format for ServiceTimer is "hours:minutes:seconds" - none of the values can exceed the normal range of each tuple.
For example this is invalid: "0:60:0" because 60 is > 59. To represent every hour you would use "1:0:0"
This example shows a value that would check for the health of the service every one hour, two minutes and three seconds
<add key="ServiceTimer" value="1:2:3"/>
This operation is fast and should probably remain low such as "0:1:0" (every minute) or "0:0:15" (every 15 seconds)
-->
<add key="ServiceTimer" value="0:1:0"/><!--default to look for updates once a minute-->
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
+7 -1
View File
@@ -11,12 +11,18 @@ namespace ZitiUpdateService {
/// The main entry point for the application.
/// </summary>
static void Main() {
UpdateService updateSvc = new UpdateService();
#if DEBUG
updateSvc.Debug();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
#else
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new UpdateService()
updateSvc
};
ServiceBase.Run(ServicesToRun);
#endif
}
}
}
+5 -5
View File
@@ -40,9 +40,9 @@ namespace ZitiUpdateService {
}
public void Debug()
{
{
OnStart(null);
}
}
protected override void OnStart(string[] args) {
try {
@@ -56,14 +56,14 @@ namespace ZitiUpdateService {
_logDirectory = Path.Combine(_rootDirectory, "Logs");
if (!Directory.Exists(_logDirectory)) Directory.CreateDirectory(_logDirectory);
Log("Setup Watchers");
SetupServiceWatcher();
SetupServiceWatchers();
}
protected override void OnStop() {
Log("Stopping update Service");
}
private void SetupWatcher() {
private void SetupServiceWatchers() {
Log("Setting Up Watchers");
var serviceTimerInterval = ConfigurationManager.AppSettings.Get("ServiceTimer");
@@ -214,7 +214,7 @@ namespace ZitiUpdateService {
Log("Starting Service");
controller.Start();
controller.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(30));
SetupWatcher();
SetupServiceWatchers();
} catch (Exception e) {
Log("Cannot Start Service - " + e.ToString());
}