[*] caught runtime regressions

This commit is contained in:
Reece Wilson 2023-09-15 18:21:47 +01:00
parent d0fb19f87e
commit ac86fd481b
2 changed files with 3 additions and 5 deletions

View File

@ -104,7 +104,7 @@ namespace Aurora::Console::Commands
}
else if (workerId)
{
Async::NewWorkFunction(workerId.value(), [=]() -> void
Async::DispatchOn(workerId.value(), [=]() -> void
{
callback->OnCommand(res.result);
});

View File

@ -74,19 +74,17 @@ namespace Aurora::IO::Net
auto old = this->callbacks_;
auto temp = AuMakeShared<AuAsync::PromiseCallbackFunctional<Status_t, Error_t>>([=](const AuSPtr<Status_t> &response)
{
auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_,[response, callbacks = old]()
(void)AuAsync::DispatchOn(this->origin_,[response, callbacks = old]()
{
callbacks->OnSuccess(response.get());
});
SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically");
},
[=](const AuSPtr<Error_t> &response)
{
auto pWorkItem = this->origin_.pool->NewWorkFunction(this->origin_, [response, callbacks = old]()
(void)AuAsync::DispatchOn(this->origin_, [response, callbacks = old]()
{
callbacks->OnFailure(response.get());
});
SysAssert(pWorkItem->Dispatch(), "A network task failed to dispatch critically");
});
if (!temp)