From aa65873fa61b7eeec8329fb9b2d553023f4224b9 Mon Sep 17 00:00:00 2001 From: Martin Zimmermann Date: Mon, 25 Nov 2013 13:50:43 +0100 Subject: [PATCH] uWSGI works also with multiprocessing.Lock --- isso/core.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/isso/core.py b/isso/core.py index 645fcde..2b584f7 100644 --- a/isso/core.py +++ b/isso/core.py @@ -5,9 +5,10 @@ from __future__ import print_function import io import os import time +import logging import binascii import threading -import logging +import multiprocessing from configparser import ConfigParser @@ -241,15 +242,7 @@ class uWSGIMixin(Mixin): super(uWSGIMixin, self).__init__(conf) - class Lock(): - - def __enter__(self): - uwsgi.lock() - - def __exit__(self, exc_type, exc_val, exc_tb): - uwsgi.unlock() - - self.lock = Lock() + self.lock = multiprocessing.Lock() self.cache = uWSGICache timedelta = conf.getint("moderation", "purge-after")