Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Adding option to skip initial import and just tail the oplog
Browse files Browse the repository at this point in the history
  • Loading branch information
fedot committed May 20, 2015
1 parent 9bcd385 commit d52acf3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mosql/cli.rb
Expand Up @@ -87,6 +87,10 @@ def parse_args
@options[:skip_tail] = true
end

opts.on("--skip-import", "Don't import data before tailing oplog") do
@options[:skip_import] = true
end

opts.on("--reimport", "Force a data re-import") do
@options[:reimport] = true
end
Expand Down Expand Up @@ -164,7 +168,9 @@ def run
:sql => @sql,
:schema => @schema)

@streamer.import
unless options[:skip_import]
@streamer.import
end

unless options[:skip_tail]
@streamer.optail
Expand Down

1 comment on commit d52acf3

@Sergepetroff
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea where else to ask that, so - what is format of BSON::Timestamp for tail-from option? I'm using below command
mosql --tail-from 1579095736

and it fails with:
mongoriver-0.4.0/lib/mongoriver/assertions.rb:6:in `assert': For mongo databases, tail :from must be a BSON::Timestamp

Please sign in to comment.