From bb1ef28d69ff5afd1428d60a61e6fcfc7674f33a Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Sun, 23 Oct 2011 19:59:53 +0200 Subject: [PATCH] updated decorators with @farm([name]) --- plugins/python/uwsgi_pymodule.c | 87 +++++++++++++++++++++++++++++++++ uwsgi.h | 2 + uwsgidecorators.py | 24 +++++++++ 3 files changed, 113 insertions(+) diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index cce27fcf..80a8cec6 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -1085,6 +1085,40 @@ PyObject *py_uwsgi_setprocname(PyObject * self, PyObject * args) { return Py_None; } +PyObject *py_uwsgi_in_farm(PyObject * self, PyObject * args) { + + char *farm_name = NULL; + int i; + + if (!PyArg_ParseTuple(args, "|s:in_farm", &farm_name)) { + return NULL; + } + + if (uwsgi.muleid == 0) goto none; + + for(i=0;i