mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
![dependabot[bot]](/assets/img/avatar_default.png)
* Chore(deps-dev): Bump the development group with 2 updates Bumps the development group with 2 updates: [ruff](https://github.com/astral-sh/ruff) and [mkdocs-material](https://github.com/squidfunk/mkdocs-material). Updates `ruff` from 0.8.6 to 0.9.2 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.8.6...0.9.2) Updates `mkdocs-material` from 9.5.49 to 9.5.50 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.49...9.5.50) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development - dependency-name: mkdocs-material dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development ... Signed-off-by: dependabot[bot] <support@github.com> * Update .pre-commit-config.yaml * Run new ruff format --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
50 lines
1.3 KiB
Python
50 lines
1.3 KiB
Python
import os
|
|
|
|
# See https://docs.gunicorn.org/en/stable/settings.html for
|
|
# explanations of settings
|
|
|
|
bind = f"{os.getenv('PAPERLESS_BIND_ADDR', '[::]')}:{os.getenv('PAPERLESS_PORT', 8000)}"
|
|
|
|
workers = int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1))
|
|
worker_class = "paperless.workers.ConfigurableWorker"
|
|
timeout = 120
|
|
preload_app = True
|
|
|
|
# https://docs.gunicorn.org/en/stable/faq.html#blocking-os-fchmod
|
|
worker_tmp_dir = "/dev/shm"
|
|
|
|
|
|
def pre_fork(server, worker):
|
|
pass
|
|
|
|
|
|
def pre_exec(server):
|
|
server.log.info("Forked child, re-executing.")
|
|
|
|
|
|
def when_ready(server):
|
|
server.log.info("Server is ready. Spawning workers")
|
|
|
|
|
|
def worker_int(worker):
|
|
worker.log.info("worker received INT or QUIT signal")
|
|
|
|
## get traceback info
|
|
import sys
|
|
import threading
|
|
import traceback
|
|
|
|
id2name = {th.ident: th.name for th in threading.enumerate()}
|
|
code = []
|
|
for threadId, stack in sys._current_frames().items():
|
|
code.append(f"\n# Thread: {id2name.get(threadId, '')}({threadId})")
|
|
for filename, lineno, name, line in traceback.extract_stack(stack):
|
|
code.append(f'File: "{filename}", line {lineno}, in {name}')
|
|
if line:
|
|
code.append(f" {line.strip()}")
|
|
worker.log.debug("\n".join(code))
|
|
|
|
|
|
def worker_abort(worker):
|
|
worker.log.info("worker received SIGABRT signal")
|