fix prometheus metric server startup
This commit is contained in:
parent
ee548390a5
commit
569715f124
1 changed files with 2 additions and 3 deletions
|
@ -184,10 +184,9 @@ namespace Geekbot.net
|
||||||
_client.ReactionRemoved += handlers.ReactionRemoved;
|
_client.ReactionRemoved += handlers.ReactionRemoved;
|
||||||
if (!_runParameters.InMemory) _client.MessageReceived += handlers.UpdateStats;
|
if (!_runParameters.InMemory) _client.MessageReceived += handlers.UpdateStats;
|
||||||
|
|
||||||
var webserver = _runParameters.DisableApi ? Task.Delay(10) : StartWebApi();
|
|
||||||
|
|
||||||
StartPrometheusServer();
|
StartPrometheusServer();
|
||||||
|
|
||||||
|
var webserver = _runParameters.DisableApi ? Task.Delay(10) : StartWebApi();
|
||||||
_logger.Information(LogSource.Geekbot, "Done and ready for use");
|
_logger.Information(LogSource.Geekbot, "Done and ready for use");
|
||||||
|
|
||||||
await webserver;
|
await webserver;
|
||||||
|
@ -217,7 +216,7 @@ namespace Geekbot.net
|
||||||
|
|
||||||
private void StartPrometheusServer()
|
private void StartPrometheusServer()
|
||||||
{
|
{
|
||||||
var port = int.Parse(_runParameters.PrometheusPort);
|
var port = _runParameters.PrometheusPort == "12991" ? 12991 : int.Parse(_runParameters.PrometheusPort);
|
||||||
var server = new MetricServer(_runParameters.PrometheusHost, port);
|
var server = new MetricServer(_runParameters.PrometheusHost, port);
|
||||||
server.Start();
|
server.Start();
|
||||||
_logger.Information(LogSource.Geekbot, $"Prometheus Metric Server running on {_runParameters.PrometheusHost}:{_runParameters.PrometheusPort}");
|
_logger.Information(LogSource.Geekbot, $"Prometheus Metric Server running on {_runParameters.PrometheusHost}:{_runParameters.PrometheusPort}");
|
||||||
|
|
Loading…
Reference in a new issue