Skip to content

Commit adb1d23

Browse files
authored
chore: Remove jRuby 9.1 listen usage guard (#283)
1 parent a35f901 commit adb1d23

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

lib/ldclient-rb/impl/integrations/file_data_source.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,7 @@ def initialize(data_store, data_source_update_sink, logger, options={})
3636
@paths = [ @paths ]
3737
end
3838
@auto_update = options[:auto_update]
39-
if @auto_update && @@have_listen && !options[:force_polling] # force_polling is used only for tests
40-
# We have seen unreliable behavior in the 'listen' gem in JRuby 9.1 (https://github.com/guard/listen/issues/449).
41-
# Therefore, on that platform we'll fall back to file polling instead.
42-
if defined?(JRUBY_VERSION) && JRUBY_VERSION.start_with?("9.1.")
43-
@use_listen = false
44-
else
45-
@use_listen = true
46-
end
47-
end
39+
@use_listen = @auto_update && @@have_listen && !options[:force_polling]
4840
@poll_interval = options[:poll_interval] || 1
4941
@initialized = Concurrent::AtomicBoolean.new(false)
5042
@ready = Concurrent::Event.new

lib/ldclient-rb/integrations/file_data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module FileData
9393
# Note that the default implementation of this feature is based on polling the filesystem,
9494
# which may not perform well. If you install the 'listen' gem (not included by default, to
9595
# avoid adding unwanted dependencies to the SDK), its native file watching mechanism will be
96-
# used instead. However, 'listen' will not be used in JRuby 9.1 due to a known instability.
96+
# used instead.
9797
# @option options [Float] :poll_interval The minimum interval, in seconds, between checks for
9898
# file modifications - used only if auto_update is true, and if the native file-watching
9999
# mechanism from 'listen' is not being used. The default value is 1 second.

0 commit comments

Comments
 (0)