Skip to content

Commit 1b40036

Browse files
committed
no crash if double starting in HttpListener
1 parent 096c5fd commit 1b40036

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Prometheus.Client.MetricServer/MetricServer.HttpListener.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public MetricServer(string hostname, int port, string url, IEnumerable<IOnDemand
6868
/// <inheritdoc />
6969
public void Start()
7070
{
71+
if (IsRunning)
72+
return;
73+
7174
var bgThread = new Thread(StartListen)
7275
{
7376
IsBackground = true,

0 commit comments

Comments
 (0)