diff --git a/playbooks/roles/gitea/files/99-max_conn_my.cnf b/playbooks/roles/gitea/files/99-max_conn_my.cnf new file mode 100644 index 0000000000..6e4910da5a --- /dev/null +++ b/playbooks/roles/gitea/files/99-max_conn_my.cnf @@ -0,0 +1,2 @@ +[mysqld] +max_connections=200 diff --git a/playbooks/roles/gitea/tasks/main.yaml b/playbooks/roles/gitea/tasks/main.yaml index 666e275514..3965bccaab 100644 --- a/playbooks/roles/gitea/tasks/main.yaml +++ b/playbooks/roles/gitea/tasks/main.yaml @@ -24,6 +24,13 @@ template: src: app.ini.j2 dest: /var/gitea/conf/app.ini +- name: Write mariadb conn limit config file + copy: + src: 99-max_conn_my.cnf + dest: /var/gitea/conf/99-max_conn_my.cnf + owner: root + group: root + mode: 0644 - name: Install distro packages package: name: diff --git a/playbooks/roles/gitea/templates/docker-compose.yaml.j2 b/playbooks/roles/gitea/templates/docker-compose.yaml.j2 index 542e70372e..504a79bb1d 100644 --- a/playbooks/roles/gitea/templates/docker-compose.yaml.j2 +++ b/playbooks/roles/gitea/templates/docker-compose.yaml.j2 @@ -14,6 +14,7 @@ services: MYSQL_PASSWORD: "{{ gitea_db_password }}" volumes: - /var/gitea/db:/var/lib/mysql + - /var/gitea/conf/99-max_conn_my.cnf:/etc/mysql/conf.d/99-max_conn_my.cnf:ro logging: driver: syslog options: diff --git a/testinfra/test_gitea.py b/testinfra/test_gitea.py index a3eb86be2c..260d681ed1 100644 --- a/testinfra/test_gitea.py +++ b/testinfra/test_gitea.py @@ -130,7 +130,7 @@ def test_no_500_template_content(host): '--resolve gitea99.opendev.org:3081:127.0.0.1 ' 'https://gitea99.opendev.org:3081' + path) assert 'status-page-500' not in cmd.stdout - assert 'Internal Server Error' not in cmd.stdout + assert '