diff options
Diffstat (limited to 'redfish-core/lib/log_services.hpp')
-rw-r--r-- | redfish-core/lib/log_services.hpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index f71f81b66d..cdd746f4d9 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -723,7 +723,7 @@ inline void deleteDumpEntry(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, } inline void - createDumpTaskCallback(const crow::Request& req, + createDumpTaskCallback(task::Payload&& payload, const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, const uint32_t& dumpId, const std::string& dumpPath, const std::string& dumpType) @@ -772,7 +772,7 @@ inline void task->startTimer(std::chrono::minutes(3)); task->populateResp(asyncResp->res); - task->payload.emplace(req); + task->payload.emplace(std::move(payload)); } inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, @@ -847,8 +847,9 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, } crow::connections::systemBus->async_method_call( - [asyncResp, req, dumpPath, dumpType](const boost::system::error_code ec, - const uint32_t& dumpId) { + [asyncResp, payload(task::Payload(req)), dumpPath, + dumpType](const boost::system::error_code ec, + const uint32_t& dumpId) mutable { if (ec) { BMCWEB_LOG_ERROR << "CreateDump resp_handler got error " << ec; @@ -857,7 +858,8 @@ inline void createDump(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, } BMCWEB_LOG_DEBUG << "Dump Created. Id: " << dumpId; - createDumpTaskCallback(req, asyncResp, dumpId, dumpPath, dumpType); + createDumpTaskCallback(std::move(payload), asyncResp, dumpId, + dumpPath, dumpType); }, "xyz.openbmc_project.Dump.Manager", "/xyz/openbmc_project/dump/" + @@ -2907,10 +2909,11 @@ inline void requestRoutesCrashdumpCollect(App& app) return; } - auto collectCrashdumpCallback = [asyncResp, req]( + auto collectCrashdumpCallback = [asyncResp, + payload(task::Payload(req))]( const boost::system::error_code ec, - const std::string&) { + const std::string&) mutable { if (ec) { if (ec.value() == @@ -2948,7 +2951,7 @@ inline void requestRoutesCrashdumpCollect(App& app) "member='PropertiesChanged',arg0namespace='com.intel.crashdump'"); task->startTimer(std::chrono::minutes(5)); task->populateResp(asyncResp->res); - task->payload.emplace(req); + task->payload.emplace(std::move(payload)); }; if (oemDiagnosticDataType == "OnDemand") |