CPP override fix

This commit is contained in:
Taha Afzal committed 2020-06-19 11:58:58 -04:00
1 parent 00bf3c7f47
commit 0ee86f2dd4
2 files changed
+21 -21

No files matched your search

@@ -323,28 +323,28 @@ void PositionServiceServer::set_base_position(
}
void PositionServiceServer::update_security_parameters(
const SecurityParametersBatchOp&,
const SecurityParametersBatchOp& req,
const api::Response<SecurityParametersBatchOpResponse>&){
// TODO
// LOG(persist, Info, "PositionServiceServer::update_security_parameters bp count:{}",
// req.op_params_size());
// for (const auto& p : req.op_params()){
// std::string key_str = std::to_string(p.security_key());
// auto db_p = me->security_params_store->retrieve_one(security_params_ns, key_str);
// auto found = db_p.first;
// if (!found) {
// me->security_params_store->insert(security_params_ns,
// key_str,
// utils::pb::to_string(p));
// }
// else {
// me->security_params_store->insert(security_params_ns,
// key_str,
// utils::pb::to_string(p));
// }
// }
// _load_security_params();
// _compute_pnl_and_publish();
LOG(persist, Info, "PositionServiceServer::update_security_parameters bp count:{}",
req.op_params_size());
for (const auto& p : req.op_params()){
std::string key_str = std::to_string(p.security_key());
auto db_p = me->security_params_store->retrieve_one(security_params_ns, key_str);
auto found = db_p.first;
if (!found) {
me->security_params_store->insert(security_params_ns,
key_str,
utils::pb::to_string(p));
}
else {
me->security_params_store->update(security_params_ns,
key_str,
utils::pb::to_string(p));
}
}
_load_security_params();
_compute_pnl_and_publish();
}
///////////////////////////////////////////////////////////////////////////////