Skip to content

Commit 1503ff2

Browse files
committed
Parse last value in background thread
1 parent 66f1228 commit 1503ff2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cbang/api/handler/TimeseriesHandler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,10 @@ void TimeseriesHandler::process() {
169169
LOG_DEBUG(3, "Last value success=" << (success ? "true" : "false"));
170170

171171
if (success) {
172+
SmartPointer<string> s = new string(value);
172173
SmartPointer<JSON::ValuePtr> last;
173174

174-
auto run = [=] () {*last = JSON::Reader::parse(value);};
175+
auto run = [=] () {*last = JSON::Reader::parse(*s);};
175176

176177
auto done = [=] (bool success) {
177178
LOG_DEBUG(3, "Parsed last value success="

0 commit comments

Comments
 (0)