Skip to content

Commit

Permalink
Merge pull request #288 from MORE-Platform/#224-fix-data-cleanup
Browse files Browse the repository at this point in the history
#224: fix data cleanup bug on study-transitions.
  • Loading branch information
andresgruber authored May 27, 2024
2 parents 1b12217 + 4f75480 commit f29335b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ public void setStatus(Long studyId, Study.Status newState, User user) {
)
);
participantService.alignParticipantsWithStudyState(s);
elasticService.deleteIndex(s.getStudyId());
if (s.getStudyState() == Study.Status.DRAFT) {
log.info("Study {} transitioned back to {}, dropping collected observation data", study.getStudyId(), s.getStudyState());
elasticService.deleteIndex(s.getStudyId());
}
} catch (Exception e) {
log.warn("Could not set new state for study id {}; old state: {}; new state: {}", studyId, oldState.getValue(), s.getStudyState().getValue());
//ROLLBACK
Expand Down

0 comments on commit f29335b

Please sign in to comment.