diff --git a/decoratortest.py b/decoratortest.py index 0ec22ae9..d22b5dd4 100644 --- a/decoratortest.py +++ b/decoratortest.py @@ -111,11 +111,12 @@ def locked_func(): print("[locked %d] waiting..." % uwsgi.worker_id()) print("done with locked function on worker %d" % uwsgi.worker_id()) -a_long_task.spool({'foo':'bar'}, hello='world') +spool_filename = a_long_task.spool({'foo':'bar'}, hello='world') +print("spool filename = %s" % spool_filename) an_infinite_task.spool(foo='bar', priority=3) delayed_task.spool(foo2='bar2', at=time.time()+60) a_running_thread() a_running_thread_with_args("uWSGI") uwsgi_source_file = open('uwsgi.c','r') -big_body_task.spool(priority=9,filename='uwsgi.c',body=uwsgi_source_file.read()) +print(big_body_task.spool(priority=9,filename='uwsgi.c',body=uwsgi_source_file.read())) uwsgi_source_file.close() diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 80e36b76..a72864bc 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -1393,11 +1393,9 @@ PyObject *py_uwsgi_send_spool(PyObject * self, PyObject * args, PyObject *kw) { Py_DECREF(spool_vars); if (i > 0) { - Py_INCREF(Py_True); - return Py_True; + return PyString_FromString(spool_filename); } - Py_INCREF(Py_None); - return Py_None; + return PyErr_Format(PyExc_ValueError, "unable to spool job"); } PyObject *py_uwsgi_spooler_pid(PyObject * self, PyObject * args) {