From 879da138f1e3355e17ab22d116214234721bd037 Mon Sep 17 00:00:00 2001 From: Mark Heiges Date: Wed, 2 Nov 2016 11:23:54 -0400 Subject: [PATCH] add customized eupathdb:fetch_changesets task that includes a Timeout; this is to address accumulation of svn processes (and system memory depletion) from redmine:fetch_changesets when server does not respond --- roles/easyredmine/files/ebrc_tasks.rake | 10 ++++++++++ roles/easyredmine/tasks/redmine.yml | 6 ++++++ .../easyredmine/templates/redmine_fetch_changesets.j2 | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 roles/easyredmine/files/ebrc_tasks.rake diff --git a/roles/easyredmine/files/ebrc_tasks.rake b/roles/easyredmine/files/ebrc_tasks.rake new file mode 100644 index 0000000..c780e7f --- /dev/null +++ b/roles/easyredmine/files/ebrc_tasks.rake @@ -0,0 +1,10 @@ +namespace :eupathdb do + + desc 'Fetch changesets from the repositories. Same as redmine:fetch_changesets but with added timeout' + task :fetch_changesets => :environment do + Timeout.timeout(120) do + Repository.fetch_changesets + end + end + +end diff --git a/roles/easyredmine/tasks/redmine.yml b/roles/easyredmine/tasks/redmine.yml index 26219d3..fbc0775 100644 --- a/roles/easyredmine/tasks/redmine.yml +++ b/roles/easyredmine/tasks/redmine.yml @@ -69,6 +69,12 @@ owner='{{ redmine_owner }}' become: yes +- name: install ebrc_tasks.rake + copy: dest='{{ redmine_root_dir }}/lib/tasks/ebrc_tasks.rake' + src='ebrc_tasks.rake' + owner='{{ redmine_owner }}' + become: yes + - name: install additional_environment.rb copy: dest='{{ redmine_root_dir }}/config/additional_environment.rb' src='additional_environment.rb' diff --git a/roles/easyredmine/templates/redmine_fetch_changesets.j2 b/roles/easyredmine/templates/redmine_fetch_changesets.j2 index 02f7dc3..d776a6e 100755 --- a/roles/easyredmine/templates/redmine_fetch_changesets.j2 +++ b/roles/easyredmine/templates/redmine_fetch_changesets.j2 @@ -5,5 +5,5 @@ cd {{ redmine_root_dir }} /usr/local/bin/bundle exec rake \ - redmine:fetch_changesets \ + eupathdb:fetch_changesets \ RAILS_ENV="production"