On 13 February 2012 08:30, Phyllipe Medeiros <phyllipece...@gmail.com> wrote:
> I have made this class:
> "class Teste(Thread):
>     def __init__(self):
>         Thread.__init__(self)
>     def run(self):
>         try:
>             print "Begin"
>             from httplib2 import Http
>             import time
>             time.sleep(20)
>             print "PASSED SLEEP"
>             response, content = Http().request("http://www.spoj.pl";)
>             print "OUT"
> except:

Within the except add:

  import sys
  import traceback
  traceback.print_exception(*sys.exc_info())

If you aren't going to re raise the exception, then how else are you
going to know what the actual problem is.

Graham

>             print "EXCEPTION :("
> "
> Then I have a view that calls Teste().start(), the message that I receive on
> error log is only "BEGIN".
> But if I do no use a thread, the "error log" will work correctly "Begin,
> PASSED SLEEP" and "OUT".
> I think it is something related to Apache2/Mod_wsgi or even permissions in
> my system, because if run it with sudo using runserver it will work
> perfectly.
> In my house it works perfectly too.
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To post to this group, send email to modw...@googlegroups.com.
> To unsubscribe from this group, send email to
> modwsgi+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

  • Thread timeout Phyllipe Medeiros
    • Re: [modwsgi] Thread timeout Graham Dumpleton

Reply via email to