doc/checker_example.rb in watchmonkey_cli-1.9.1 vs doc/checker_example.rb in watchmonkey_cli-1.10.0
- old
+ new
@@ -10,9 +10,17 @@
# ============
# This name defines how you can add tests in your configs.
# e.g. my_checker "http://google.com", some_option: true
self.checker_name = "my_checker"
+ # Maximum amount of time this task may run before it gets killed.
+ # Set to 0/false to have no time limit whatsoever.
+ # Set to proc to evaluate at runtime
+ # Defaults to app.opts[:maxrt] if nil/unset
+ #self.maxrt = false
+ #self.maxrt = 5.minutes
+ #self.maxrt = ->(app, checker, args){ app.opts[:maxrt] && app.opts[:maxrt] * 2 }
+
# Called by configuration defining a check with all the arguments.
# e.g. my_checker "http://google.com", some_option: true
# Should invoke `app.enqueue` which will by default call `#check!` method with given arguments.
def enqueue host, opts = {}
opts = { some_option: false }.merge(opts)