-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move all gunicorn config into gunicorn.conf.py and update configuration to, like, work. * Remove unused, empty directory. * Blacken gunicorn.conf.py * Optimize search output import and translation - Make `_GLOBAL_CONSTRAINTS` a constant instead of generating on each request - Don't import the raw data to the `ListPersonsOutput` model until AFTER it has been filtered - Simplify RecordConstraint logic by only operating on Dicts, instead of Generic Types (which also speeds things up quite a lot) - Stop duplicate filtering in translator.py that is already handled by PWS. - Update tests to work with new logic. * Fix minor typo in pws model documentation * [Bot] Update version to 2.0.2 Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b9c212c
commit d8129bf
Showing
16 changed files
with
182 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
import gevent.monkey | ||
|
||
gevent.monkey.patch_all() | ||
|
||
worker_class = "gevent" | ||
import os | ||
from multiprocessing import cpu_count | ||
|
||
|
||
def worker_exit(worker, server): | ||
worker.log.info(f"Server {server} shutting down . . .") | ||
|
||
|
||
def max_workers(): | ||
default_max = 2 * cpu_count() + 1 | ||
return os.environ.get("GUNICORN_MAX_WORKERS", default_max) | ||
|
||
|
||
def max_threads(): | ||
default_max = 4 | ||
return os.environ.get("GUNICORN_MAX_THREADS", default_max) | ||
|
||
|
||
max_requests = 1000 | ||
bind = "0.0.0.0:8000" | ||
worker_class = "gthread" | ||
workers = max_workers() | ||
threads = max_threads() | ||
loglevel = os.environ.get("GUNICORN_LOG_LEVEL", "DEBUG") | ||
reload = os.environ.get("FLASK_ENV") == "development" | ||
preload_app = os.environ.get("FLASK_ENV") != "development" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.