Il giorno 11/gen/2012, alle ore 11:23, Łukasz Wróblewski ha scritto:

> ----- Oryginalna wiadomość -----
>> Od: "Roberto De Ioris" <[email protected]>
>> Do: "uWSGI developers and users list" <[email protected]>
>> Wysłane: środa, 11 styczeń 2012 11:17:26
>> Temat: Re: [uWSGI] after req hook
>> 
>> you have put a sleep in the request handler, not in the
>> after_req_hook.
>> 
>> harakiri will be always available for request handler, will be
>> disabled in after_req_hook on demand
>> 


> 
> uwsgi.after_req_hook = after_req
> 
> def timer(id):
>  print('************* timer start')
>  #time.sleep(10)
>  raise Exception('yyy')
>  print('************* timer end')

You can call it directly here (in the timer function):

   uwsgi.after_req_hook()

The reference count of the function is increased on startup, so you could use 
it everywhere.

--
Roberto De Ioris
http://unbit.it
JID: [email protected]

_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to