Yeah, sure.

/etc/uwsgi.xml:

<uwsgi>
<vhost></vhost>
<master></master>
<socket>127.0.0.1:8013</socket>
<enable-threads/>
<spooler>/home/projects/sites/spooler</spooler>
<close-on-exec/>
</uwsgi>


part of nginx:
uwsgi_pass   127.0.0.1:8013;
        include        uwsgi_params;
        uwsgi_param UWSGI_CHDIR /home/projects/sites/tour;
        uwsgi_param UWSGI_SCRIPT runsite;
        uwsgi_param UWSGI_PYHOME /home/projects/sites/tour;


uwsgi_params:

uwsgi_param     QUERY_STRING            $query_string;
uwsgi_param     REQUEST_METHOD          $request_method;
uwsgi_param     CONTENT_TYPE            $content_type;
uwsgi_param     CONTENT_LENGTH          $content_length;

uwsgi_param     REQUEST_URI             $request_uri;
uwsgi_param     PATH_INFO               $document_uri;
uwsgi_param     DOCUMENT_ROOT           $document_root;
uwsgi_param     SERVER_PROTOCOL         $server_protocol;

uwsgi_param     REMOTE_ADDR             $remote_addr;
uwsgi_param     REMOTE_PORT             $remote_port;
uwsgi_param     SERVER_PORT             $server_port;
uwsgi_param     SERVER_NAME             $server_name;




On 06/22/2011 07:54 PM, Roberto De Ioris wrote:

Hi, Roberto!
I have added, but it continue to work as previously:
Maybe something else in code is not OK?

def calculation(env):
          print "Started spooler!!!!!!!!!!!"
          print env
          time.sleep(10)
          with open("/tmp/test", "w") as g:
                  g.write("Test file")
          print "Finished spooler!!!!!!!"
          return uwsgi.SPOOL_OK

uwsgi.spooler = calculation
application = WSGIHandler()

I see that there's created a spool-file with name like
uwsgi_spoolfile_on_mysite_471_3_0_1308747513_39964 with keywords in
this, but seems that function "calculation" doesn't work - "/tmp/test"
is not created and nothing is printed.
Where can be a mistake?
Thanks!
P.S. (uWSGI version - 0.9.8)


On 06/21/2011 07:35 PM, Roberto De Ioris wrote:

Hi!
I try to run spooler feature on django-uwsgi-nginx setup with
virtualenv.
   From uwsgi config:
    <spooler>/home/projects/sites/spooler</spooler>
     From my runsite wsgi script:

import uwsgi
def calculation(env):
           print "Started spooler!!!!!!!!!!!"
           print env
           time.sleep(10)
           with open("/tmp/test", "w") as g:
                   g.write("Test file")
           print "Finished spooler!!!!!!!"



Starting from 0.9.7 branch you have to explicitly inform the spooler
that
your job has been successfull returning:

return uwsgi.SPOOL_OK

i have updated the doc. Sorry for the inconvenient



can you post the full uWSGI config ?


Thanks

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

Reply via email to