From 9dcaf91443ff803ab2a69711faf077c254abdf3b Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Tue, 26 Sep 2023 01:56:40 +0800 Subject: [PATCH] modify requirements to accommodate m2 local development --- admin/base/wsgi.py | 9 --------- api/base/wsgi.py | 8 -------- framework/postcommit_tasks/handlers.py | 8 -------- main.py | 2 -- requirements.txt | 3 +-- 5 files changed, 1 insertion(+), 29 deletions(-) diff --git a/admin/base/wsgi.py b/admin/base/wsgi.py index 005fca01d25..8ae7cb71b0f 100644 --- a/admin/base/wsgi.py +++ b/admin/base/wsgi.py @@ -6,15 +6,6 @@ For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ -from website import settings - -if not settings.DEBUG_MODE: - from gevent import monkey - monkey.patch_all() - # PATCH: avoid deadlock on getaddrinfo, this patch is necessary while waiting for - # the final gevent 1.1 release (https://github.com/gevent/gevent/issues/349) - # 'foo'.encode('idna') # noqa - import os # noqa from django.core.wsgi import get_wsgi_application # noqa from website.app import init_app # noqa diff --git a/api/base/wsgi.py b/api/base/wsgi.py index 12269aa6146..da724488102 100644 --- a/api/base/wsgi.py +++ b/api/base/wsgi.py @@ -6,16 +6,8 @@ For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ -from website import settings from api.base import settings as api_settings -if not settings.DEBUG_MODE: - from gevent import monkey - monkey.patch_all() - # PATCH: avoid deadlock on getaddrinfo, this patch is necessary while waiting for - # the final gevent 1.1 release (https://github.com/gevent/gevent/issues/349) - # 'foo'.encode('idna') # noqa - import os # noqa from django.core.wsgi import get_wsgi_application # noqa from website.app import init_app # noqa diff --git a/framework/postcommit_tasks/handlers.py b/framework/postcommit_tasks/handlers.py index a6934c0ca5f..5fe3b303413 100644 --- a/framework/postcommit_tasks/handlers.py +++ b/framework/postcommit_tasks/handlers.py @@ -10,7 +10,6 @@ from celery.canvas import Signature from celery.local import PromiseProxy -from gevent.pool import Pool from flask import _app_ctx_stack as context_stack from website import settings @@ -38,13 +37,6 @@ def postcommit_after_request(response, base_status_error_code=500): _local.postcommit_celery_queue = OrderedDict() return response try: - if postcommit_queue(): - number_of_threads = 30 # one db connection per greenlet, let's share - pool = Pool(number_of_threads) - for func in postcommit_queue().values(): - pool.spawn(func) - pool.join(timeout=5.0, raise_error=True) # 5 second timeout and reraise exceptions - if postcommit_celery_queue(): if settings.USE_CELERY: for task_dict in postcommit_celery_queue().values(): diff --git a/main.py b/main.py index 4f37229766b..90e33594788 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -from gevent import monkey -monkey.patch_all() # PATCH: avoid deadlock on getaddrinfo, this patch is necessary while waiting for # the final gevent 1.1 release (https://github.com/gevent/gevent/issues/349) diff --git a/requirements.txt b/requirements.txt index 84747393ec6..1ec63236d55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,6 @@ future==0.18.2 invoke==0.15.0 Werkzeug==1.0.0 Flask==1.0 -gevent==1.2.2 Mako==1.0.7 Markdown==3.3.7 WTForms==1.0.4 @@ -82,7 +81,7 @@ django-storages==1.6.6 google-cloud-storage==0.22.0 # dependency of django-storages, hard-pin to version django-dirtyfields==1.3.1 django-extensions==3.2.0 -psycopg2==2.7.3 --no-binary psycopg2 +psycopg2-binary==2.9.7 django-bulk-update==2.2.0 # Reviews requirements