logs errors in worker loop

This commit is contained in:
ThatBen 2025-04-03 14:28:23 +02:00
parent b5f3dfe034
commit 2c9f9d1008
No known key found for this signature in database
GPG Key ID: 62C543548433D43E

View File

@ -43,9 +43,9 @@ namespace AutoClient
public void Queue(Action<CodexWrapper> action)
{
if (queue.Count > 2) log.Log("Queue full. Waiting...");
while (queue.Count > 2)
{
log.Log("Queue full. Waiting...");
Thread.Sleep(TimeSpan.FromSeconds(5.0));
}
@ -56,6 +56,8 @@ namespace AutoClient
}
private void Worker()
{
try
{
while (running)
{
@ -71,6 +73,12 @@ namespace AutoClient
action(instance);
}
}
catch (Exception ex)
{
log.Error("Exception in worker: " + ex);
throw;
}
}
}
public LoadBalancer(App app, CodexWrapper[] instances)