Skip to content

Commit cb8d4ef

Browse files
author
Raihan Habib
committed
Proposed fix for mongo_tail replica_set incompatibility
Signed-off-by: Raihan Habib <[email protected]>
1 parent ccd9065 commit cb8d4ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/fluent/plugin/in_mongo_tail.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def run
118118
private
119119

120120
def client
121-
@client_options[:database] = @database
121+
@client_options[:database] = @database if @database
122122
@client_options[:user] = @user if @user
123123
@client_options[:password] = @password if @password
124-
Mongo::Client.new(["#{node_string}"], @client_options)
124+
Mongo::Client.new(node_string, @client_options)
125125
end
126126

127127
def get_collection
@@ -133,9 +133,9 @@ def get_collection
133133
def node_string
134134
case
135135
when @database
136-
"#{@host}:#{@port}"
136+
["#{@host}:#{@port}"]
137137
when @url
138-
@url
138+
"#{@url}"
139139
end
140140
end
141141

0 commit comments

Comments
 (0)