comparison Plugins/Engine/OrthancPluginDatabase.cpp @ 3105:2e1711f80f74 db-changes

More consistent handling of the "Last" field returned by the "/changes" URI
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 10 Jan 2019 18:02:34 +0100
parents b2b6db5ad9a5
children f86ebf971a72
comparison
equal deleted inserted replaced
3101:b2b6db5ad9a5 3105:2e1711f80f74
276 } 276 }
277 else 277 else
278 { 278 {
279 LOG(WARNING) << "Performance warning in the database index: Some extensions are missing in the plugin"; 279 LOG(WARNING) << "Performance warning in the database index: Some extensions are missing in the plugin";
280 } 280 }
281
282 if (extensions_.getLastChangeIndex == NULL)
283 {
284 LOG(WARNING) << "The database extension GetLastChangeIndex() is missing";
285 }
281 } 286 }
282 287
283 288
284 void OrthancPluginDatabase::Open() 289 void OrthancPluginDatabase::Open()
285 { 290 {
1390 CheckSuccess(extensions_.getChildrenMetadata 1395 CheckSuccess(extensions_.getChildrenMetadata
1391 (GetContext(), payload_, resourceId, static_cast<int32_t>(metadata))); 1396 (GetContext(), payload_, resourceId, static_cast<int32_t>(metadata)));
1392 ForwardAnswers(target); 1397 ForwardAnswers(target);
1393 } 1398 }
1394 } 1399 }
1400
1401
1402 int64_t OrthancPluginDatabase::GetLastChangeIndex()
1403 {
1404 if (extensions_.getLastChangeIndex == NULL)
1405 {
1406 // This was the default behavior in Orthanc <= 1.5.1
1407 // https://groups.google.com/d/msg/orthanc-users/QhzB6vxYeZ0/YxabgqpfBAAJ
1408 return 0;
1409 }
1410 else
1411 {
1412 int64_t result = 0;
1413 CheckSuccess(extensions_.getLastChangeIndex(&result, payload_));
1414 return result;
1415 }
1416 }
1395 } 1417 }