From b87c2d02abae4941ab1c35da0c9833ef78b33b9e Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 23 May 2019 13:01:02 -0700 Subject: [PATCH] Add cron to gc on gitea servers As new change refs accumulate, replication pushes and page loads will take longer as git stats all of the refs/ files. To avoid that, pack refs and gc every week to keep the number of files and space used minimal. Change-Id: Iff273ebbc25a512ab7e12b8418ceb30e7c722f92 --- playbooks/roles/gitea/tasks/main.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/playbooks/roles/gitea/tasks/main.yaml b/playbooks/roles/gitea/tasks/main.yaml index 08e8128d09..90bb04db09 100644 --- a/playbooks/roles/gitea/tasks/main.yaml +++ b/playbooks/roles/gitea/tasks/main.yaml @@ -126,3 +126,11 @@ key: "{{ gitea_gerrit_public_key }}" read_only: false title: "Gerrit replication key" +- name: Set up cron job to pack git refs + cron: + name: pack-git-refs + state: present + job: "docker exec -t giteadocker_gitea-web_1 find /data/git/repositories/ -maxdepth 2 -name *.git -type d -execdir git --git-dir={} gc \\;" + minute: 37 + hour: 12 + weekday: 0