On 05:01 pm, [email protected] wrote: >Greetings, > >I need to render a page with Nevow containing data extracted from a >database. The query might take time so it is taken care of with >twisted.adbapi, and thus with a Deferred. > >My render function returns this Deferred - to which some callbacks have >been added to format the data. All is well as long as the request is >fast enough for the Deferred to be dealt with quasi-synchronously. If >the query takes too much time, the render function simply returns the >Deferred, which is set at None, instead of its result value.
It's hard to tell from the code that you've posted, but it sounds like your "too much time" case is probably triggering a different path through your code - one that results in one of the necessary Deferreds not being chained to the Deferred returned from your renderHTTP implementation. This results in the renderHTTP Deferred firing while some other asynchronous task is still going on. Are you aware of nevow.guard, which implements authentication in a general way and can be applied to arbitrary other pages? That might let you delete a lot of your code, possibly getting rid of the bug in the process, but at least reducing the amount of code you need to look through to find the problem. Jean-Paul _______________________________________________ Twisted-web mailing list [email protected] http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
