2

How do I configure the default timeout for a all async actions? Can it be done on a controller base?

Right now, my code is something like:

def severalSecondsLongAction() {
    def ctx = startAsync()
    ctx.timeout = 100000
    ctx.start {
        sleep(20000)
        render "It took a time!"
        ctx.complete()
    }
}

It is working, but all my async actions can be, potentially, that long. How can I configure the timeout globally?

As a bonus, I really like the syntax using tasks, but how can I access the context in that way?

Fernando
  • 2,131
  • 3
  • 27
  • 46

0 Answers0