return the name of the spoolfile on uwsgi.spool()

This commit is contained in:
roberto@centos6
2011-07-12 20:20:55 +02:00
parent 9d8ee5aec8
commit 73e94350df
2 changed files with 5 additions and 6 deletions
+3 -2
View File
@@ -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()
+2 -4
View File
@@ -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) {