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

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

Reply via email to