On 14 Mar 2013, at 4:45 AM, Daniel Gonzalez <[email protected]> wrote:
> Thanks Niphlod, I am making progress thanks to your suggestions.
>
> I have a strange effect: if I do
>
> def finish_request(xxx): # It receives None as parameter, I do not know why
> print "yadayada"
>
> response.custom_commit = finish_request
>
> My function gets called, at the end of the request, *twice* in rapid
> succession. Is this expected? Maybe a web2py bug? (using commit 10c67e5, from
> 4 days ago)
>
It's normal, IIRC. It's called with different arguments, once for each db
thread and once with None. When I use it (to do some cache flushing after the
db commits), my function looks like this:
def oncommit(_db):
"custom_commit callback: commit, then flush the cache"
if _db is None: # after all commits
flush_active_channels()
else:
_db.commit() # not called for Google Datastore
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.