From 2fba1dd539edacb5754e7819099820c79ea9272f Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Mon, 09 Jul 2012 20:32:38 +0000 Subject: Pootle notification: don't time out on git interaction Pootle notification is a non-interactive process, so it doesn't need to time out like interactive requests do (because the user isn't not going to be interested in the result if it takes too long). It's not possible to give a single number that's correct most of the time, so let's just deactivate the timeout. If git would go haywire for some reason, we'd notice it using different means (e.g. Munin). --- diff --git a/lib/emailer.rb b/lib/emailer.rb index a98cb2e..8e56c50 100644 --- a/lib/emailer.rb +++ b/lib/emailer.rb @@ -25,7 +25,10 @@ module Emailer author = event.commit_details[:commit_author] begin - files = repository.git.commit(sha).diffs.map {|i| i.a_path} + files = [] + Grit::Git.with_timeout(0) do + files += repository.git.commit(sha).diffs.map {|i| i.a_path} + end langs = files.collect {|i| next unless i =~ /^po\/(.*).po$/; $1}.compact.join(', ') rescue Exception => e logger.warn("Failed to get git diff to compose poole commit files: #{e}") -- cgit v0.9.1