<commit_before># vim: set ft=jinja:
#################################################
# Gunicorn config for {{ app_name }}
#################################################

bind = '{{ gunicorn_host }}:{{ gunicorn_port }}'
worker_class = '{{ worker_class }}'

# configure number of gunicorn workers
{% if 'env' in grains and grains['env'] == 'dev' %}
workers = 1
{% elif workers is defined %}
workers = {{ workers }}
{% else %}
import multiprocessing
workers = multiprocessing.cpu_count() * 2 + 1
{% endif %}

# dont daemonize; use supervisor
daemon = False
timeout = {{ timeout }}
proc_name = 'gunicorn-{{ app_name }}'
pidfile = '/tmp/gunicorn-{{ app_name }}.pid'

# error log to STDERR
errorlog = '-'
{% if 'env' in grains and grains['env'] == 'dev' %}
loglevel = 'debug'
debug = True
{% else %}
loglevel = '{{ loglevel }}'
debug = False
{% endif %}
<commit_msg>gunicorn: logging levels and better grain usage<commit_after># vim: set ft=jinja:
#################################################
# Gunicorn config for {{ app_name }}
#################################################

bind = '{{ gunicorn_host }}:{{ gunicorn_port }}'
worker_class = '{{ worker_class }}'

# configure number of gunicorn workers
{% if grains.get('env', '') == 'dev' %}
workers = 1
{% elif workers is defined %}
workers = {{ workers }}
{% else %}
import multiprocessing
workers = multiprocessing.cpu_count() * 2 + 1
{% endif %}

# dont daemonize; use supervisor
daemon = False
timeout = {{ timeout }}
proc_name = 'gunicorn-{{ app_name }}'
pidfile = '/tmp/gunicorn-{{ app_name }}.pid'

# error log to STDERR
errorlog = '-'
{% if grains.get('env', '') == 'dev' %}
loglevel = 'debug'
{% else %}
loglevel = '{{ loglevel }}'
{% endif %}

{'fraction_non_alphanumeric': 0.27527761542957335, 'fraction_numerical': 0.0035067212156633548, 'mean_word_length': 5.092526690391459, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2100488', 'n_tokens_mistral': 586, 'n_tokens_neox': 520, 'n_words': 150}