the cache can now contains upto 0xFFFFFFFF items, added uwsgi.cache_exists to the api

This commit is contained in:
roberto@sirium
2010-12-15 10:47:01 +01:00
parent eff66ef08f
commit a8c4f6bffe
5 changed files with 33 additions and 9 deletions
+19
View File
@@ -1936,6 +1936,24 @@ PyObject *py_uwsgi_cache_set(PyObject * self, PyObject * args) {
}
PyObject *py_uwsgi_cache_exists(PyObject * self, PyObject * args) {
char *key ;
if (!PyArg_ParseTuple(args, "s:cache_exists", &key)) {
return NULL;
}
if (uwsgi_cache_exists(key, strlen(key))) {
Py_INCREF(Py_True);
return Py_True;
}
Py_INCREF(Py_None);
return Py_None;
}
PyObject *py_uwsgi_cache_get(PyObject * self, PyObject * args) {
char *key ;
@@ -1961,6 +1979,7 @@ static PyMethodDef uwsgi_cache_methods[] = {
{"cache_get", py_uwsgi_cache_get, METH_VARARGS, ""},
{"cache_set", py_uwsgi_cache_set, METH_VARARGS, ""},
{"cache_del", py_uwsgi_cache_del, METH_VARARGS, ""},
{"cache_exists", py_uwsgi_cache_exists, METH_VARARGS, ""},
{NULL, NULL},
};