Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove jRuby 9.1 listen usage guard #283

Merged
merged 1 commit into from
Jun 3, 2024
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
10 changes: 1 addition & 9 deletions lib/ldclient-rb/impl/integrations/file_data_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ def initialize(data_store, data_source_update_sink, logger, options={})
@paths = [ @paths ]
end
@auto_update = options[:auto_update]
if @auto_update && @@have_listen && !options[:force_polling] # force_polling is used only for tests
# We have seen unreliable behavior in the 'listen' gem in JRuby 9.1 (https://github.com/guard/listen/issues/449).
# Therefore, on that platform we'll fall back to file polling instead.
if defined?(JRUBY_VERSION) && JRUBY_VERSION.start_with?("9.1.")
@use_listen = false
else
@use_listen = true
end
end
@use_listen = @auto_update && @@have_listen && !options[:force_polling]
@poll_interval = options[:poll_interval] || 1
@initialized = Concurrent::AtomicBoolean.new(false)
@ready = Concurrent::Event.new
Expand Down
2 changes: 1 addition & 1 deletion lib/ldclient-rb/integrations/file_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ module FileData
# Note that the default implementation of this feature is based on polling the filesystem,
# which may not perform well. If you install the 'listen' gem (not included by default, to
# avoid adding unwanted dependencies to the SDK), its native file watching mechanism will be
# used instead. However, 'listen' will not be used in JRuby 9.1 due to a known instability.
# used instead.
# @option options [Float] :poll_interval The minimum interval, in seconds, between checks for
# file modifications - used only if auto_update is true, and if the native file-watching
# mechanism from 'listen' is not being used. The default value is 1 second.
Expand Down