Skip to content

Commit

Permalink
When stopping the running server, also stop the plugin change scanner.
Browse files Browse the repository at this point in the history
Previously, subsequent server startups caused error messages complaining that the plugin change scanner was still running.
  • Loading branch information
ldaley committed Nov 25, 2009
1 parent 394c783 commit 6779eb9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/_GrailsRun.groovy
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ target(startPluginScanner: "Starts the plugin manager's scanner that detects cha
PluginManagerHolder.pluginManager.startPluginChangeScanner() PluginManagerHolder.pluginManager.startPluginChangeScanner()
} }


target(stopPluginScanner: "Stops the plugin manager's scanner that detects changes to artifacts.") {
PluginManagerHolder.pluginManager.stopPluginChangeScanner()
}

/** /**
* Keeps the server alive and checks for changes in domain classes or * Keeps the server alive and checks for changes in domain classes or
* source files under "src". If any changes are detected, the servlet * source files under "src". If any changes are detected, the servlet
Expand Down Expand Up @@ -300,6 +304,15 @@ target(stopServer: "Stops the Grails servlet container") {
e.printStackTrace() e.printStackTrace()
println "Error stopping server: ${e.message}" println "Error stopping server: ${e.message}"
} }

try {
stopPluginScanner()
}
catch (Throwable e) {
GrailsUtil.deepSanitize(e)
e.printStackTrace()
println "Error stopping plugin change scanner: ${e.message}"
}
} }
event("StatusFinal", ["Server stopped"]) event("StatusFinal", ["Server stopped"])
} }
Expand Down

0 comments on commit 6779eb9

Please sign in to comment.