From fd4be51591f349314c3758f5ca68b3c6978a218c Mon Sep 17 00:00:00 2001 From: Artem Grinev Date: Fri, 24 May 2024 06:00:50 +0000 Subject: [PATCH] fix(daemon): start sync detached Fixes #36 --- daemon/presentation/web-controllers/PackageController.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/presentation/web-controllers/PackageController.cpp b/daemon/presentation/web-controllers/PackageController.cpp index f04bd20d..174e38d5 100644 --- a/daemon/presentation/web-controllers/PackageController.cpp +++ b/daemon/presentation/web-controllers/PackageController.cpp @@ -32,8 +32,10 @@ using namespace drogon; drogon::Task PackageController::sync(drogon::HttpRequestPtr req) { BXT_JWT_CHECK_PERMISSIONS("packages.sync", req) - - co_await m_sync_service.sync_all(); + drogon::async_run([this]() -> drogon::Task { + co_await m_sync_service.sync_all(); + co_return; + }); co_return HttpResponse::newHttpResponse(); }