Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/ldclient-rb/impl/data_source/polling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ def poll
error_info
)
else
@ready.set # if client was waiting on us, make it stop waiting - has no effect if already set
# Publish the OFF status before releasing anyone waiting on the
# ready event, so a client that returns from start can rely on the
# data source status already reflecting the failure.
stop_with_error_info error_info
@ready.set # if client was waiting on us, make it stop waiting - has no effect if already set
end
rescue StandardError => e
Impl::Util.log_exception(@config.logger, "Exception while polling", e)
Expand Down
18 changes: 9 additions & 9 deletions spec/impl/data_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@ module DataStore

describe "hash" do
it "constant instances are equal to themselves" do
expect(FEATURES.hash).to be FEATURES.hash
expect(SEGMENTS.hash).to be SEGMENTS.hash
expect(FEATURES.hash).to eq FEATURES.hash
expect(SEGMENTS.hash).to eq SEGMENTS.hash
end

it "same constructions are equal" do
expect(FEATURES.hash).to be DataKind.new(namespace: "features", priority: 1).hash
expect(DataKind.new(namespace: "features", priority: 1).hash).to be DataKind.new(namespace: "features", priority: 1).hash
expect(FEATURES.hash).to eq DataKind.new(namespace: "features", priority: 1).hash
expect(DataKind.new(namespace: "features", priority: 1).hash).to eq DataKind.new(namespace: "features", priority: 1).hash

expect(SEGMENTS.hash).to be DataKind.new(namespace: "segments", priority: 0).hash
expect(DataKind.new(namespace: "segments", priority: 0).hash).to be DataKind.new(namespace: "segments", priority: 0).hash
expect(SEGMENTS.hash).to eq DataKind.new(namespace: "segments", priority: 0).hash
expect(DataKind.new(namespace: "segments", priority: 0).hash).to eq DataKind.new(namespace: "segments", priority: 0).hash
end

it "distinct namespaces are not equal" do
expect(DataKind.new(namespace: "features", priority: 1).hash).not_to be DataKind.new(namespace: "segments", priority: 1).hash
expect(DataKind.new(namespace: "features", priority: 1).hash).not_to eq DataKind.new(namespace: "segments", priority: 1).hash
end

it "distinct priorities are not equal" do
expect(DataKind.new(namespace: "features", priority: 1).hash).not_to be DataKind.new(namespace: "features", priority: 2).hash
expect(DataKind.new(namespace: "segments", priority: 1).hash).not_to be DataKind.new(namespace: "segments", priority: 2).hash
expect(DataKind.new(namespace: "features", priority: 1).hash).not_to eq DataKind.new(namespace: "features", priority: 2).hash
expect(DataKind.new(namespace: "segments", priority: 1).hash).not_to eq DataKind.new(namespace: "segments", priority: 2).hash
end
end
end
Expand Down
Loading