Skip to content

Commit

Permalink
Cancel scheduled Storage Verification of Series on Cache Storage on …
Browse files Browse the repository at this point in the history
…deletion of objects from this Storage fix #4251
  • Loading branch information
gunterze committed Oct 10, 2023
1 parent 5fb525a commit 3a2bc22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
Expand Up @@ -392,6 +392,11 @@ private boolean deleteObjectsOfStudy(Study study, StorageDescriptor desc) {
scheduleMetadataUpdate(series.getPk());
}
updateStorageIDs(study, storageIDs);
if (!study.hasStorageIDs()) {
em.createNamedQuery(Series.CANCEL_STORAGE_VERIFICATION_OF_STUDY)
.setParameter(1, study)
.executeUpdate();
}
updateInstanceAvailability(study, desc.getInstanceAvailability(), remainingInstanceAvailability(desc));
return true;
}
Expand Down
Expand Up @@ -254,6 +254,10 @@
"se.pk, se.storageVerificationTime, se.seriesInstanceUID, se.study.studyInstanceUID) " +
"from Series se " +
"where se.storageVerificationTime < current_timestamp"),
@NamedQuery(
name = Series.CANCEL_STORAGE_VERIFICATION_OF_STUDY,
query = "update Series se set se.storageVerificationTime = null " +
"where se.study = ?1"),
@NamedQuery(
name = Series.SCHEDULED_COMPRESSION,
query = "select new org.dcm4chee.arc.entity.Series$Compression(" +
Expand Down Expand Up @@ -380,6 +384,7 @@ public class Series {
public static final String FIND_BY_STUDY_PK_AND_INSTANCE_PURGE_STATE = "Series.findByStudyPkAndInstancePurgeState";
public static final String UPDATE_STGVER_FAILURES = "Series.updateStgVerFailures";
public static final String SCHEDULED_STORAGE_VERIFICATION = "Series.scheduledStorageVerification";
public static final String CANCEL_STORAGE_VERIFICATION_OF_STUDY = "Series.cancelStorageVerificationOfStudy";
public static final String SCHEDULED_COMPRESSION = "Series.scheduledCompression";
public static final String INCREMENT_METADATA_UPDATE_FAILURES = "Series.setMetadataScheduledUpdateTime";
public static final String SET_METADATA = "Series.setMetadata";
Expand Down
Expand Up @@ -433,6 +433,10 @@ public String getEncodedStorageIDs() {
return storageIDs;
}

public boolean hasStorageIDs() {
return storageIDs == null;
}

public String[] getStorageIDs() {
return StringUtils.split(storageIDs, '\\');
}
Expand Down

0 comments on commit 3a2bc22

Please sign in to comment.