From b38a17e8f215373b94b5acfa09fd6abf7dd2cc10 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Sun, 15 Dec 2024 22:03:37 +0500 Subject: [PATCH] Forgejo: limit db connections --- roles/forgejo/meta/argument_specs.yml | 2 ++ roles/forgejo/templates/app.ini.j2 | 1 + roles/forgejo/vars/main.yml | 1 + 3 files changed, 4 insertions(+) diff --git a/roles/forgejo/meta/argument_specs.yml b/roles/forgejo/meta/argument_specs.yml index b6445ee..7c0060e 100644 --- a/roles/forgejo/meta/argument_specs.yml +++ b/roles/forgejo/meta/argument_specs.yml @@ -38,6 +38,8 @@ argument_specs: type: str db_password: type: str + db_max_open_conns: + type: int log_level: type: str log_root_path: diff --git a/roles/forgejo/templates/app.ini.j2 b/roles/forgejo/templates/app.ini.j2 index 21a2a72..176b46c 100644 --- a/roles/forgejo/templates/app.ini.j2 +++ b/roles/forgejo/templates/app.ini.j2 @@ -9,6 +9,7 @@ HOST={{ db_host }} NAME={{ db_name }} USER={{ db_user }} PASSWD={{ db_password }} +MAX_OPEN_CONNS={{ db_max_open_conns }} [storage] diff --git a/roles/forgejo/vars/main.yml b/roles/forgejo/vars/main.yml index e1450af..5cb86f2 100644 --- a/roles/forgejo/vars/main.yml +++ b/roles/forgejo/vars/main.yml @@ -26,6 +26,7 @@ db_host: postgresql:5432 db_name: forgejo db_user: forgejo db_password: "" +db_max_open_conns: 10 log_level: warn log_root_path: /data/log