a bunch of threading fixes in the spooler

This commit is contained in:
roberto@debian32
2011-08-04 14:11:40 +02:00
parent eb0ce609f0
commit 9bd3022a5e
2 changed files with 5 additions and 2 deletions
+5 -1
View File
@@ -826,6 +826,8 @@ char *uwsgi_pythonize(char *orig) {
void uwsgi_python_spooler_init(void) {
struct uwsgi_string_list *upli = up.spooler_import_list;
UWSGI_GET_GIL
while(upli) {
if (strchr(upli->value, '/') || uwsgi_endswith(upli->value, ".py")) {
uwsgi_pyimport_by_filename(uwsgi_pythonize(upli->value), upli->value);
@@ -837,6 +839,7 @@ void uwsgi_python_spooler_init(void) {
}
upli = upli->next;
}
UWSGI_RELEASE_GIL
}
@@ -1206,8 +1209,9 @@ int uwsgi_python_spooler(char *filename, char *buf, uint16_t len, char *body, si
PyDict_SetItemString(spool_dict, "body", PyString_FromStringAndSize(body, body_len));
}
PyTuple_SetItem(pyargs, 0, spool_dict);
ret = python_call(spool_func, pyargs, 0);
if (ret) {
if (!PyInt_Check(ret)) {
// error, retry