uWSGI works also with multiprocessing.Lock
This commit is contained in:
parent
6405f258f3
commit
aa65873fa6
13
isso/core.py
13
isso/core.py
@ -5,9 +5,10 @@ from __future__ import print_function
|
|||||||
import io
|
import io
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
import logging
|
||||||
import binascii
|
import binascii
|
||||||
import threading
|
import threading
|
||||||
import logging
|
import multiprocessing
|
||||||
|
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
|
||||||
@ -241,15 +242,7 @@ class uWSGIMixin(Mixin):
|
|||||||
|
|
||||||
super(uWSGIMixin, self).__init__(conf)
|
super(uWSGIMixin, self).__init__(conf)
|
||||||
|
|
||||||
class Lock():
|
self.lock = multiprocessing.Lock()
|
||||||
|
|
||||||
def __enter__(self):
|
|
||||||
uwsgi.lock()
|
|
||||||
|
|
||||||
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
||||||
uwsgi.unlock()
|
|
||||||
|
|
||||||
self.lock = Lock()
|
|
||||||
self.cache = uWSGICache
|
self.cache = uWSGICache
|
||||||
|
|
||||||
timedelta = conf.getint("moderation", "purge-after")
|
timedelta = conf.getint("moderation", "purge-after")
|
||||||
|
Loading…
Reference in New Issue
Block a user