Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp @ 4991:3cdda1cec537
fix
author | Alain Mazy <am@osimis.io> |
---|---|
date | Sun, 01 May 2022 12:38:52 +0200 |
parents | 8fba26292a9f |
children | 8feb00fea93d |
comparison
equal
deleted
inserted
replaced
4990:b1fe3b44ce1d | 4991:3cdda1cec537 |
---|---|
24 #include "../Common/OrthancPluginCppWrapper.h" | 24 #include "../Common/OrthancPluginCppWrapper.h" |
25 | 25 |
26 #include <boost/thread.hpp> | 26 #include <boost/thread.hpp> |
27 #include <boost/algorithm/string.hpp> | 27 #include <boost/algorithm/string.hpp> |
28 #include <boost/date_time/posix_time/posix_time.hpp> | 28 #include <boost/date_time/posix_time/posix_time.hpp> |
29 #include <boost/date_time/special_defs.hpp> | |
29 #include <json/value.h> | 30 #include <json/value.h> |
30 #include <json/writer.h> | 31 #include <json/writer.h> |
31 #include <string.h> | 32 #include <string.h> |
32 #include <iostream> | 33 #include <iostream> |
33 #include <algorithm> | 34 #include <algorithm> |
255 | 256 |
256 target["Version"] = statusVersion; | 257 target["Version"] = statusVersion; |
257 target["LastProcessedChange"] = Json::Value::Int64(lastProcessedChange); | 258 target["LastProcessedChange"] = Json::Value::Int64(lastProcessedChange); |
258 target["LastChangeToProcess"] = Json::Value::Int64(lastChangeToProcess); | 259 target["LastChangeToProcess"] = Json::Value::Int64(lastChangeToProcess); |
259 | 260 |
260 if (lastTimeStarted == boost::posix_time::special_values::not_a_date_time) | 261 if (lastTimeStarted == boost::date_time::special_values::not_a_date_time) |
261 { | 262 { |
262 target["LastTimeStarted"] = Json::Value::null; | 263 target["LastTimeStarted"] = Json::Value::null; |
263 } | 264 } |
264 else | 265 else |
265 { | 266 { |
275 statusVersion = source["Version"].asInt(); | 276 statusVersion = source["Version"].asInt(); |
276 lastProcessedChange = source["LastProcessedChange"].asInt64(); | 277 lastProcessedChange = source["LastProcessedChange"].asInt64(); |
277 lastChangeToProcess = source["LastChangeToProcess"].asInt64(); | 278 lastChangeToProcess = source["LastChangeToProcess"].asInt64(); |
278 if (source["LastTimeStarted"].isNull()) | 279 if (source["LastTimeStarted"].isNull()) |
279 { | 280 { |
280 lastTimeStarted = boost::posix_time::special_values::not_a_date_time; | 281 lastTimeStarted = boost::date_time::special_values::not_a_date_time; |
281 } | 282 } |
282 else | 283 else |
283 { | 284 { |
284 lastTimeStarted = boost::posix_time::from_iso_string(source["LastTimeStarted"].asString()); | 285 lastTimeStarted = boost::posix_time::from_iso_string(source["LastTimeStarted"].asString()); |
285 } | 286 } |