mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
synced 2025-11-05 21:28:02 +00:00
Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
@@ -23,7 +23,9 @@ namespace OpenWifi::RESTAPI_RPC {
|
||||
if (StorageService()->AddCommand(Cmd.SerialNumber, Cmd, Status)) {
|
||||
Poco::JSON::Object RetObj;
|
||||
Cmd.to_json(RetObj);
|
||||
return Handler->ReturnObject(RetObj);
|
||||
if(Handler!= nullptr)
|
||||
return Handler->ReturnObject(RetObj);
|
||||
return;
|
||||
}
|
||||
return Handler->ReturnStatus(Poco::Net::HTTPResponse::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
@@ -114,17 +116,23 @@ namespace OpenWifi::RESTAPI_RPC {
|
||||
Logger.information( fmt::format("Command({}): completed in {:.3f}ms.", Cmd.UUID, Cmd.executionTime));
|
||||
return;
|
||||
} else {
|
||||
SetCommandStatus(Cmd, Request, Response, Handler,
|
||||
Storage::COMMAND_FAILED, Logger);
|
||||
Logger.information(fmt::format(
|
||||
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
|
||||
Cmd.executionTime = rpc_execution_time.count();
|
||||
if(Cmd.Command=="ping") {
|
||||
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_COMPLETED, Logger);
|
||||
Logger.information(fmt::format(
|
||||
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
|
||||
} else {
|
||||
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_FAILED, Logger);
|
||||
Logger.information(fmt::format(
|
||||
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
SetCommandStatus(Cmd, Request, Response, Handler, Storage::COMMAND_FAILED,
|
||||
Logger);
|
||||
Logger.information(fmt::format(
|
||||
"Invalid response for command '{}'. Missing status.", Cmd.UUID));
|
||||
"Invalid response for command '{}'. Missing result.", Cmd.UUID));
|
||||
return;
|
||||
}
|
||||
} else if (rpc_result == std::future_status::timeout) {
|
||||
|
||||
Reference in New Issue
Block a user