Commit aa9a289c authored by Marin Jankovski's avatar Marin Jankovski

Make mail_room idle_timeout option configurable.

parent 05be65f3
...@@ -138,6 +138,8 @@ production: &base ...@@ -138,6 +138,8 @@ production: &base
# The mailbox where incoming mail will end up. Usually "inbox". # The mailbox where incoming mail will end up. Usually "inbox".
mailbox: "inbox" mailbox: "inbox"
# The mailbox where incoming mail will end up. Usually "inbox".
idle_timeout: 60
## Build Artifacts ## Build Artifacts
artifacts: artifacts:
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
:start_tls: <%= config[:start_tls].to_json %> :start_tls: <%= config[:start_tls].to_json %>
:email: <%= config[:user].to_json %> :email: <%= config[:user].to_json %>
:password: <%= config[:password].to_json %> :password: <%= config[:password].to_json %>
:idle_timeout: 60 :idle_timeout: <%= config[:idle_timeout].to_json %>
:name: <%= config[:mailbox].to_json %> :name: <%= config[:mailbox].to_json %>
......
...@@ -31,6 +31,7 @@ module Gitlab ...@@ -31,6 +31,7 @@ module Gitlab
config[:ssl] = false if config[:ssl].nil? config[:ssl] = false if config[:ssl].nil?
config[:start_tls] = false if config[:start_tls].nil? config[:start_tls] = false if config[:start_tls].nil?
config[:mailbox] = 'inbox' if config[:mailbox].nil? config[:mailbox] = 'inbox' if config[:mailbox].nil?
config[:idle_timeout] = 60 if config[:idle_timeout].nil?
if config[:enabled] && config[:address] if config[:enabled] && config[:address]
gitlab_redis = Gitlab::Redis.new(rails_env) gitlab_redis = Gitlab::Redis.new(rails_env)
......
...@@ -47,6 +47,7 @@ describe 'mail_room.yml' do ...@@ -47,6 +47,7 @@ describe 'mail_room.yml' do
expect(mailbox[:email]).to eq('gitlab-incoming@gmail.com') expect(mailbox[:email]).to eq('gitlab-incoming@gmail.com')
expect(mailbox[:password]).to eq('[REDACTED]') expect(mailbox[:password]).to eq('[REDACTED]')
expect(mailbox[:name]).to eq('inbox') expect(mailbox[:name]).to eq('inbox')
expect(mailbox[:idle_timeout]).to eq(60)
redis_url = gitlab_redis.url redis_url = gitlab_redis.url
sentinels = gitlab_redis.sentinels sentinels = gitlab_redis.sentinels
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment