Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Allowing a custom collection name for oplog tailing (some configs use…
Browse files Browse the repository at this point in the history
… master/slave naming)
  • Loading branch information
mrkurt committed Feb 28, 2013
1 parent f3f2a18 commit 2126492
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/mongoriver/tailer.rb
Expand Up @@ -3,10 +3,12 @@ class Tailer
include Mongoriver::Logging

attr_reader :upstream_conn
attr_reader :oplog

def initialize(upstreams, type)
def initialize(upstreams, type, oplog = "oplog.rs")
@upstreams = upstreams
@type = type
@oplog = oplog
# This number seems high
@conn_opts = {:op_timeout => 86400}

Expand Down Expand Up @@ -61,7 +63,7 @@ def parse_host_spec(host_spec)
end

def oplog_collection
@upstream_conn.db('local').collection('oplog.rs')
@upstream_conn.db('local').collection(oplog)
end

def tail_from(ts, opts = {})
Expand Down

0 comments on commit 2126492

Please sign in to comment.