Closed hmvs closed 3 years ago
You could call ProcessQueue inside of here:
context.Response.OnCompleted(() => { // Perform slow code here. return Task.CompletedTask; });
or on the last line of your function. Did that solve it?
I've tried these two variants. Both of them responds only when the whole code executes, including part in OnCompleted
block.
[HttpGet("{id}")]
public IActionResult Get(int id) {
this.HttpContext.Response.OnCompleted(() => {
Startup.ExceptionlessClient.ProcessQueue();
for (long i = 0; i <= 8000000000; i++) {
}
return Task.CompletedTask;
});
return Ok("exit ok");
}
[HttpGet("{id}")]
public IActionResult Get(int id) {
this.HttpContext.Response.OnCompleted(() => {
return Task.WhenAll(Startup.ExceptionlessClient.ProcessQueueAsync(), Task.Delay(20000));
});
return Ok("exit ok");
}
The inner for loop won't do anything because the compiler will remove it. You'd be better to just call ProcessQueueAsync and await it otherwise a deadlock could occur. Were you able to get any further on this issue?
Were you able to get any further on this issue?
Unfortunately, no. Just thought we need some very lightweight client.
What happens if you call ExceptionlessClient.Default.Startup() in your app. Does it always report the events?
We just made some huge improvements to our ASP.NET Core client to better support functions. Can you please upgrade to https://github.com/exceptionless/Exceptionless.Net/releases/tag/v4.6.2 and let us know if you run into any issues.
Hi guys.
As far as AWS lambda freezes all background threads right after returning results, exceptionless is not working, seems to be because of Timers also get frozen.
2019-08-19T14:47:23.0338945+00:00
I invoked Lambda with a parameter that triggersProcessQueue()
method.See: related