Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add interval to config

  • Loading branch information...
commit 859eb56b91c3210679789afaf08280c537f22f32 1 parent 0b3027d
Tomohiro TAIRA Tomohiro authored
Showing with 8 additions and 3 deletions.
  1. +2 −1  config/config.yml.example
  2. +6 −2 lib/redmine_irc_gateway/session.rb
3  config/config.yml.example
View
@@ -1,6 +1,7 @@
default:
site: http://redmine.example.com
-
+ interval: 300 # Crawl interval (default 60s * 5m = 300s)
+
# profile name - IRC user name or IRC login name
profile_name:
site: http://redmine.example.com # Not required
8 lib/redmine_irc_gateway/session.rb
View
@@ -23,8 +23,7 @@ def on_user message
auto_join_to_channels
- interval = 60
- crawl_recent_issues(interval) do |issue|
+ crawl_recent_issues(get_crawl_interval) do |issue|
privmsg issue
end
@@ -54,6 +53,11 @@ def on_disconnected
private
+ def get_crawl_interval
+ config = RedmineIRCGateway::Config.load
+ interval = config.get(@user.profile)['interval'] || config.default['interval'] || 300
+ end
+
def auto_join_to_channels
@timeline = Channel.timeline
join @timeline
Please sign in to comment.
Something went wrong with that request. Please try again.