[backend/core] Don't log queue service exception on application exit

This commit is contained in:
Laura Hausmann 2024-02-20 01:42:29 +01:00
parent d976f82636
commit cbd4b576e2
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -110,8 +110,11 @@ public class JobQueue<T>(
}
catch (Exception e)
{
logger.LogError("DelayedJobHandlerAsync in queue {queue} failed with: {error}", name, e.Message);
await Task.Delay(1000, token);
if (!token.IsCancellationRequested)
{
logger.LogError("DelayedJobHandlerAsync in queue {queue} failed with: {error}", name, e.Message);
await Task.Delay(1000, token);
}
}
}
}
@ -140,8 +143,11 @@ public class JobQueue<T>(
}
catch (Exception e)
{
logger.LogError("ExecuteAsync in queue {queue} failed with: {error}", name, e.Message);
await Task.Delay(1000, token);
if (!token.IsCancellationRequested)
{
logger.LogError("ExecuteAsync in queue {queue} failed with: {error}", name, e.Message);
await Task.Delay(1000, token);
}
}
}
}