Set the default gitaly timeout to 0 (unlimited) if running within a Rake command
The following discussion from !27299 (merged) should be addressed:
-
@reprazent started a discussion: (+1 comment) This is either called from a rake task
lib/tasks/gitlab/git.rake
and from theapp/workers/repository_check/single_repository_worker.rb
.So I'm ok with this.
In the linked example, we were able to change the RPC timeout to 'unlimited' unconditionally, because it happened not to be called from rails controller code. However, I think we need a general-purpose means to detect whether we're running inside rake (or the rails console, for that matter - I've often found myself defining Sidekiq.server?
to return true
there) so we can extend Gitaly default timeouts there too.