Commit b85d3342 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

messages: cache as array.

Change-Id: I48ee8176e62f0efcb9c44ee09884b9e28916d726
parent f3c8554c
......@@ -178,7 +178,7 @@ MessageEngine::load()
for (auto m = pmessages.begin(); m != pmessages.end(); ++m) {
const auto& jmsg = *m;
MessageToken token;
std::istringstream iss(i.key().asString());
std::istringstream iss(m.key().asString());
iss >> std::hex >> token;
Message msg;
msg.status = (MessageStatus)jmsg["status"].asInt();
......@@ -219,7 +219,7 @@ MessageEngine::save_() const
continue;
Json::Value msg;
std::ostringstream msgsId;
msgsId << std::hex << c.first;
msgsId << std::hex << m.first;
msg["status"] = (int)(v.status == MessageStatus::SENDING ? MessageStatus::IDLE : v.status);
msg["to"] = v.to;
auto wall_time = std::chrono::system_clock::now() + std::chrono::duration_cast<std::chrono::system_clock::duration>(v.last_op - clock::now());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment