Skip to content
Snippets Groups Projects
Commit 725abd0f authored by Tim Olsen's avatar Tim Olsen
Browse files

XNAT-4458: Modified SystemPathVerification to only email when resources are...

XNAT-4458: Modified SystemPathVerification to only email when resources are present, catch all Throwable errors, and cleaned up display names.
parent db576e1c
No related branches found
No related tags found
No related merge requests found
...@@ -13,3 +13,4 @@ gradle.properties ...@@ -13,3 +13,4 @@ gradle.properties
InstanceSettings.xml InstanceSettings.xml
src/main/resources/META-INF/xnat/auth src/main/resources/META-INF/xnat/auth
MANIFEST.MF MANIFEST.MF
/ide-bin/
...@@ -51,13 +51,14 @@ public class SystemPathVerification extends AbstractInitializingTask { ...@@ -51,13 +51,14 @@ public class SystemPathVerification extends AbstractInitializingTask {
public void run() { public void run() {
if (_appInfo.isInitialized()) { if (_appInfo.isInitialized()) {
try { try {
validatePath(_config.getArchivePath(), "Archive", true); final Integer resourceCount = _template.queryForObject("SELECT COUNT(xnat_abstractresource_id) AS COUNT FROM xnat_abstractresource", Integer.class);
validatePath(_config.getArchivePath(), "Archive", (resourceCount>0));
validatePath(_config.getCachePath(), "Cache", false); validatePath(_config.getCachePath(), "Cache", false);
validatePath(_config.getPipelinePath(), "Pipeline", false); validatePath(_config.getPipelinePath(), "Pipeline", false);
validatePath(_config.getBuildPath(), "Build", false); validatePath(_config.getBuildPath(), "Build", false);
validatePath(_config.getPrearchivePath(), "Prearchive", false); validatePath(_config.getPrearchivePath(), "Prearchive", false);
final Integer resourceCount = _template.queryForObject("SELECT COUNT(xnat_abstractresource_id) AS COUNT FROM xnat_abstractresource", Integer.class);
if (pathErrors.size() > 0) { if (pathErrors.size() > 0) {
// Send warning email to admin and issue browser notification // Send warning email to admin and issue browser notification
notifyOfPathErrors(resourceCount); notifyOfPathErrors(resourceCount);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment