lib/rocket_job/worker.rb in rocketjob-3.5.2 vs lib/rocket_job/worker.rb in rocketjob-4.0.0
- old
+ new
@@ -45,11 +45,11 @@
false
end
@name = "#{server_name}:#{id}"
@re_check_seconds = (re_check_seconds || 60).to_f
@re_check_start = Time.now
- @filter = filter || {}
+ @filter = filter.nil? ? {} : filter.dup
@current_filter = @filter.dup
@thread = Thread.new { run } unless inline
end
if defined?(Concurrent::JavaAtomicBoolean) || defined?(Concurrent::CAtomicBoolean)
@@ -119,9 +119,9 @@
# Only clear out the current_filter after every `re_check_seconds`
time = Time.now
return unless (time - @re_check_start) > re_check_seconds
@re_check_start = time
- self.current_filter = filter.dup
+ self.current_filter = filter.dup if current_filter != filter
end
end
end