@@ -152,6 +152,9 @@ class TimerTask < RubyExecutorService
152152 # Default `:execution_interval` in seconds.
153153 EXECUTION_INTERVAL = 60
154154
155+ # Default `:timeout_interval` in seconds.
156+ TIMEOUT_INTERVAL = 30
157+
155158 # Create a new TimerTask with the given task and configuration.
156159 #
157160 # @!macro timer_task_initialize
@@ -239,6 +242,20 @@ def execution_interval=(value)
239242 end
240243 end
241244
245+ # @!attribute [rw] timeout_interval
246+ # @return [Fixnum] Number of seconds the task can run before it is
247+ # considered to have failed.
248+ def timeout_interval
249+ warn 'TimerTask timeouts are now ignored as these were not able to be implemented correctly'
250+ end
251+
252+ # @!attribute [rw] timeout_interval
253+ # @return [Fixnum] Number of seconds the task can run before it is
254+ # considered to have failed.
255+ def timeout_interval = ( value )
256+ warn 'TimerTask timeouts are now ignored as these were not able to be implemented correctly'
257+ end
258+
242259 private :post , :<<
243260
244261 private
@@ -247,6 +264,9 @@ def ns_initialize(opts, &task)
247264 set_deref_options ( opts )
248265
249266 self . execution_interval = opts [ :execution ] || opts [ :execution_interval ] || EXECUTION_INTERVAL
267+ if opts [ :timeout ] || opts [ :timeout_interval ]
268+ warn 'TimeTask timeouts are now ignored as these were not able to be implemented correctly'
269+ end
250270 @run_now = opts [ :now ] || opts [ :run_now ]
251271 @executor = Concurrent ::SafeTaskExecutor . new ( task )
252272 @running = Concurrent ::AtomicBoolean . new ( false )
0 commit comments