mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Yield event handlers to task queue before handling
This commit is contained in:
parent
a689d61788
commit
ea476d4051
1 changed files with 4 additions and 0 deletions
|
|
@ -254,6 +254,10 @@ namespace PluralKit.Bot
|
|||
// Inner function so we can await the handler without stalling the entire pipeline
|
||||
async Task Inner()
|
||||
{
|
||||
// "Fork" this task off by ~~yeeting~~ yielding it at the back of the task queue
|
||||
// This prevents any synchronous nonsense from also stalling the pipeline before the first await point
|
||||
await Task.Yield();
|
||||
|
||||
// Create a DI scope for this event
|
||||
// and log the breadcrumb to the newly created (in-svc-scope) Sentry scope
|
||||
using (var scope = _services.CreateScope())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue