From 353af927d2cb8394a93c57dcaead0d0f14b4e746 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Tue, 27 Jun 2017 21:50:23 -0700 Subject: Add additional error caching for redis when using a tcp address to connect instead of a socket This helps with compiling gitlab assets without a redis server (used during omnibus build) --- lib/gitlab/current_settings.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb index 818b3d9c46b..7f1932da3b7 100644 --- a/lib/gitlab/current_settings.rb +++ b/lib/gitlab/current_settings.rb @@ -25,7 +25,7 @@ module Gitlab def cached_application_settings begin ::ApplicationSetting.cached - rescue ::Redis::BaseError, ::Errno::ENOENT + rescue ::Redis::BaseError, ::Errno::ENOENT, ::Errno::EADDRNOTAVAIL # In case Redis isn't running or the Redis UNIX socket file is not available end end @@ -36,7 +36,7 @@ module Gitlab # This loads from the database into the cache, so handle Redis errors begin db_settings = ::ApplicationSetting.current - rescue ::Redis::BaseError, ::Errno::ENOENT + rescue ::Redis::BaseError, ::Errno::ENOENT, ::Errno::EADDRNOTAVAIL # In case Redis isn't running or the Redis UNIX socket file is not available end -- cgit v1.2.1 From ba4250c119df661f32bc7e72b8001798464a9785 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Tue, 27 Jun 2017 23:13:36 -0700 Subject: Update sidekiq redis error rescue to include addrnotavail --- config/initializers/sidekiq.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index ecd73956488..3be4cd797aa 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -74,5 +74,5 @@ begin end end end -rescue Redis::BaseError, SocketError, Errno::ENOENT, Errno::EAFNOSUPPORT, Errno::ECONNRESET, Errno::ECONNREFUSED +rescue Redis::BaseError, SocketError, Errno::ENOENT, Errno::EADDRNOTAVAIL, Errno::EAFNOSUPPORT, Errno::ECONNRESET, Errno::ECONNREFUSED end -- cgit v1.2.1