Skip to content

Commit

Permalink
Removed code references to eDNA controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchiecarroll committed Oct 18, 2024
1 parent 583a959 commit 4ea1f8f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Source/Applications/openHistorian/openHistorian/ServiceHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,10 @@ protected override void ServiceStartedHandler(object sender, EventArgs e)

CategorizedSettingsElementCollection systemSettings = ConfigurationFile.Current.Settings["systemSettings"];

#if !MONO
if (systemSettings["eDNAGrafanaControllerEnabled", true]?.Value.ParseBoolean() ?? true)
ServiceHelper.ClientRequestHandlers.Add(new ClientRequestHandler("eDNARefreshMetadata", "Refreshes eDNA metadata.", RefreshMetaDataHandler, new[] { "eDNARefresh", "RefresheDNAMetadata" }));
#endif

if (!Model.Global.GrafanaServerInstalled)
return;
Expand All @@ -611,11 +613,11 @@ protected override void ServiceStartedHandler(object sender, EventArgs e)
DateTime startTime = DateTime.UtcNow;
bool timeout = false;
#if DEBUG
#if DEBUG
// Debugging adds run-time overhead, provide more time for initialization
initializationTimeout *= 3;
int attempts = 0;
#endif
#endif
// Give initialization - which includes starting Grafana server process - a chance to start
while (!GrafanaAuthProxyController.ServerIsResponding())
Expand All @@ -629,10 +631,10 @@ protected override void ServiceStartedHandler(object sender, EventArgs e)
Thread.Sleep(500);
#if DEBUG
#if DEBUG
if (++attempts % 4 == 0)
DisplayStatusMessage($"DEBUG: Awaiting Grafana initialization, {attempts:N0} attempts so far...", UpdateType.Warning);
#endif
#endif
}
if (timeout)
Expand All @@ -653,7 +655,12 @@ protected override void ServiceStartedHandler(object sender, EventArgs e)
.Start();
}

private void RefreshMetaDataHandler(ClientRequestInfo requestInfo) => eDNAGrafanaController.eDNAGrafanaController.RefreshAllMetaData();
#if !MONO
private void RefreshMetaDataHandler(ClientRequestInfo requestInfo)
{
eDNAGrafanaController.eDNAGrafanaController.RefreshAllMetaData();
}
#endif

protected override void ServiceStoppingHandler(object sender, EventArgs e)
{
Expand Down Expand Up @@ -1351,7 +1358,7 @@ private static void LogMessage(MessageLevel level, string eventName, string mess
log.Publish(level, eventName, message, details, ex);
}

#endregion
#endregion

#region [ Static ]

Expand Down

0 comments on commit 4ea1f8f

Please sign in to comment.