mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Move monkey patch command in web UI and add dynamic threading
This commit is contained in:
parent
ff7cb04c31
commit
cff05457d1
2 changed files with 13 additions and 6 deletions
|
|
@ -1,5 +1,16 @@
|
|||
from os import sep
|
||||
from os import cpu_count, getenv, sep
|
||||
from os.path import join
|
||||
from sys import path as sys_path
|
||||
|
||||
deps_path = join(sep, "usr", "share", "bunkerweb", "deps", "python")
|
||||
if deps_path not in sys_path:
|
||||
sys_path.append(deps_path)
|
||||
|
||||
from gevent import monkey
|
||||
|
||||
monkey.patch_all()
|
||||
|
||||
MAX_THREADS = int(getenv("MAX_THREADS", max((cpu_count() or 1) - 1, 1)) * 2)
|
||||
|
||||
wsgi_app = "main:app"
|
||||
accesslog = "/var/log/bunkerweb/ui-access.log"
|
||||
|
|
@ -12,7 +23,7 @@ pidfile = join(sep, "var", "run", "bunkerweb", "ui.pid")
|
|||
worker_tmp_dir = join(sep, "dev", "shm")
|
||||
tmp_upload_dir = join(sep, "var", "tmp", "bunkerweb", "ui")
|
||||
worker_class = "gevent"
|
||||
threads = 1
|
||||
threads = MAX_THREADS
|
||||
workers = 1
|
||||
graceful_timeout = 0
|
||||
secure_scheme_headers = {}
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ for deps_path in [join(sep, "usr", "share", "bunkerweb", *paths) for paths in ((
|
|||
if deps_path not in sys_path:
|
||||
sys_path.append(deps_path)
|
||||
|
||||
from gevent import monkey
|
||||
|
||||
monkey.patch_all()
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from copy import deepcopy
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
|
|
|||
Loading…
Reference in a new issue