Skip to content

Commit 6b5f5ff

Browse files
committed
#354 WatchTask now doesn't throw REST module failures
1 parent 482ad1d commit 6b5f5ff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/groovy/com/marklogic/gradle/task/client/WatchTask.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,19 @@ class WatchTask extends MarkLogicTask {
4242

4343
if (loader instanceof DefaultModulesLoader) {
4444
DefaultModulesLoader dml = (DefaultModulesLoader) loader
45+
46+
/**
47+
* This is unfortunately more complicated than it should be. catchExceptions doesn't really apply to
48+
* REST modules because REST modules are loaded async - unless DefaultModulesLoader's thread count is set
49+
* to 1, in which case catchExceptions suffices. rethrowRestModulesFailure was added in 3.7.0 of
50+
* ml-javaclient-util to cause deployments to fail when REST modules fail to load, which is good default
51+
* behavior but isn't good for this task.
52+
*/
4553
dml.setCatchExceptions(true)
54+
dml.setRethrowRestModulesFailure(false)
55+
4656
dml.setShutdownTaskExecutorAfterLoadingModules(false)
57+
4758
if (project.hasProperty("ignoreDirty") && "true".equals(project.property("ignoreDirty"))) {
4859
ModulesManager mgr = dml.getModulesManager()
4960
if (mgr instanceof PropertiesModuleManager) {

0 commit comments

Comments
 (0)