A strange problem occuring in this snippet:
class FooController {
def barService
def update = {
log.debug("I'm getting executed")
barService.doFoo()
render "Done"
}
}
When I now enter http://my.domain.tld/fancyapp/foo/update in a browser (Firefox in my case), the code in update is executed three times.
EDIT 1: barService.doFoo() contains heavy calculations, so it takes quite long to finish.
EDIT 2: @hvgotcodes: no, sorry, no authentication and my UrlMappings.groovy looks like this:
class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/"(view:"/index")
"500"(view:'/error')
}
}
@Jarred: No, only the usual suspects Bootstrap.groovy, BuildConfig.groovy, Config.groovy, DataSource.groovy and UrlMappings.groovy.
Hints anyone?
If the request takes too long the browser may retry the request. If you can improve the performance of your doFoo() method it should only execute once.