How to set timeout in deploy_revision provider?

I found a situation where the chef threw a Chef :: Exceptions :: CommandTimeout exception on the clone git command. Sometimes the git clone time can be more than 10 minutes. How to set a timeout value for such situations in a chef's recipe?

+4
source share
3 answers

The timeout for the git provider seems to be fixed now.

Checkout the code at: https://github.com/opscode/chef/blob/master/lib/chef/provider/git.rb#L292

So, for the git resource, you can simply add the timeout attribute, i.e.:

 git /var/www do repository <githubrepo> action :sync user www-data group www-data timeout 1200 end 
+5
source

There is no easy way to change the timeout, I mean passing some attributes. You will have to rewrite the run_options method in the git provider . Check. When the monkey fixes the method, can you call the overridden method from the new implementation? for different possibilities.

+1
source

same question here. thanks for the help. I could write a monkey patch like this:

https://gist.github.com/mikesmullin/5660466

0
source

All Articles