comparison OrthancServer/Sources/Database/StatelessDatabaseOperations.cpp @ 5603:b2a97dfd719f

monitoring of stable resources now also considers the resource type
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 08 May 2024 10:29:35 +0200
parents c1ed59a5bdc2
children 3f24eb4013d8 0e16e677fe64
comparison
equal deleted inserted replaced
5599:3487684fd331 5603:b2a97dfd719f
964 964
965 if (type == ResourceType_Patient || 965 if (type == ResourceType_Patient ||
966 type == ResourceType_Study || 966 type == ResourceType_Study ||
967 type == ResourceType_Series) 967 type == ResourceType_Series)
968 { 968 {
969 target.isStable_ = !transaction.GetTransactionContext().IsUnstableResource(internalId); 969 target.isStable_ = !transaction.GetTransactionContext().IsUnstableResource(type, internalId);
970 970
971 if (LookupStringMetadata(tmp, target.metadata_, MetadataType_LastUpdate)) 971 if (LookupStringMetadata(tmp, target.metadata_, MetadataType_LastUpdate))
972 { 972 {
973 target.lastUpdate_ = tmp; 973 target.lastUpdate_ = tmp;
974 } 974 }
3521 transaction.LogChange(status.seriesId_, ChangeType_NewChildInstance, ResourceType_Series, hashSeries_); 3521 transaction.LogChange(status.seriesId_, ChangeType_NewChildInstance, ResourceType_Series, hashSeries_);
3522 transaction.LogChange(status.studyId_, ChangeType_NewChildInstance, ResourceType_Study, hashStudy_); 3522 transaction.LogChange(status.studyId_, ChangeType_NewChildInstance, ResourceType_Study, hashStudy_);
3523 transaction.LogChange(status.patientId_, ChangeType_NewChildInstance, ResourceType_Patient, hashPatient_); 3523 transaction.LogChange(status.patientId_, ChangeType_NewChildInstance, ResourceType_Patient, hashPatient_);
3524 3524
3525 // Mark the parent resources of this instance as unstable 3525 // Mark the parent resources of this instance as unstable
3526 transaction.GetTransactionContext().MarkAsUnstable(status.seriesId_, ResourceType_Series, hashSeries_); 3526 transaction.GetTransactionContext().MarkAsUnstable(ResourceType_Series, status.seriesId_, hashSeries_);
3527 transaction.GetTransactionContext().MarkAsUnstable(status.studyId_, ResourceType_Study, hashStudy_); 3527 transaction.GetTransactionContext().MarkAsUnstable(ResourceType_Study, status.studyId_, hashStudy_);
3528 transaction.GetTransactionContext().MarkAsUnstable(status.patientId_, ResourceType_Patient, hashPatient_); 3528 transaction.GetTransactionContext().MarkAsUnstable(ResourceType_Patient, status.patientId_, hashPatient_);
3529 transaction.GetTransactionContext().SignalAttachmentsAdded(instanceSize); 3529 transaction.GetTransactionContext().SignalAttachmentsAdded(instanceSize);
3530 3530
3531 storeStatus_ = StoreStatus_Success; 3531 storeStatus_ = StoreStatus_Success;
3532 } 3532 }
3533 }; 3533 };