Mercurial > prosody-modules
comparison mod_http_host_status_check/mod_http_host_status_check.lua @ 2229:2a7e9d9e7339
mod_http_host_status_check: Bump default timeout threshold to 10s (from 5s). Heartbeats default to every 5s.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 02 Jul 2016 16:05:02 +0100 |
| parents | 03a4c3209f21 |
| children | 85cf9a8b4020 |
comparison
equal
deleted
inserted
replaced
| 2228:03a4c3209f21 | 2229:2a7e9d9e7339 |
|---|---|
| 5 local time = require "socket".gettime; | 5 local time = require "socket".gettime; |
| 6 local template = require "util.interpolation".new("%b{}", function (s) return s end) | 6 local template = require "util.interpolation".new("%b{}", function (s) return s end) |
| 7 | 7 |
| 8 module:depends "http" | 8 module:depends "http" |
| 9 | 9 |
| 10 local threshold = module:get_option_number("status_check_heartbeat_threshold", 5); | 10 local threshold = module:get_option_number("status_check_heartbeat_threshold", 10); |
| 11 | 11 |
| 12 local function status_string(status, duration, comment) | 12 local function status_string(status, duration, comment) |
| 13 local string_timestamp; | 13 local string_timestamp; |
| 14 if duration then | 14 if duration then |
| 15 string_timestamp = ("(%0.2fs%s)"):format(duration, comment or ""); | 15 string_timestamp = ("(%0.2fs%s)"):format(duration, comment or ""); |
