RED-5892: Consolidated attribute changes and state changes.
Moved the change to the full-reprocess-status after a exclusion or auto-analysis flag toggle into the FileStatusService, so that the changes can be run in a transaction, which will prevent other threads from seeing incomplete changes.
This commit is contained in:
parent
5e7bd282cf
commit
af9f68d498
@ -23,26 +23,13 @@ public class ExcludeFromAnalysisService {
|
||||
}
|
||||
|
||||
// toggle status
|
||||
fileStatusService.toggleExclusion(fileId, excluded);
|
||||
|
||||
if (!excluded) {
|
||||
// if file has been re-enabled - process it
|
||||
fileStatusService.setStatusFullReprocess(dossierId, fileId, false, true);
|
||||
}
|
||||
|
||||
fileStatusService.toggleExclusion(dossierId, fileId, excluded);
|
||||
}
|
||||
|
||||
|
||||
public void toggleAutomaticAnalysis(String dossierId, String fileId, boolean excludedFromAutomaticAnalysis) {
|
||||
|
||||
// toggle status
|
||||
fileStatusService.toggleAutomaticAnalysis(fileId, excludedFromAutomaticAnalysis);
|
||||
|
||||
if (!excludedFromAutomaticAnalysis) {
|
||||
// if file has been re-enabled - process it
|
||||
fileStatusService.setStatusFullReprocess(dossierId, fileId, false, true);
|
||||
}
|
||||
|
||||
fileStatusService.toggleAutomaticAnalysis(dossierId, fileId, excludedFromAutomaticAnalysis);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -350,15 +350,25 @@ public class FileStatusService {
|
||||
}
|
||||
|
||||
|
||||
public void toggleExclusion(String fileId, boolean excluded) {
|
||||
@Transactional
|
||||
public void toggleExclusion(String dossierId, String fileId, boolean excluded) {
|
||||
|
||||
fileStatusPersistenceService.toggleExclusion(fileId, excluded);
|
||||
|
||||
if (!excluded) {
|
||||
setStatusFullReprocess(dossierId, fileId, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void toggleAutomaticAnalysis(String fileId, boolean excludedFromAutomaticAnalysis) {
|
||||
@Transactional
|
||||
public void toggleAutomaticAnalysis(String dossierId, String fileId, boolean excludedFromAutomaticAnalysis) {
|
||||
|
||||
fileStatusPersistenceService.toggleAutomaticAnalysis(fileId, excludedFromAutomaticAnalysis);
|
||||
|
||||
if (!excludedFromAutomaticAnalysis) {
|
||||
setStatusFullReprocess(dossierId, fileId, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user