Mercurial > prosody-modules
comparison mod_pinger/mod_pinger.lua @ 3113:8298b06e6603
mod_pinger: work around updates on stale sessions
| author | Georg Lukas <georg@op-co.de> |
|---|---|
| date | Wed, 13 Jun 2018 08:16:45 +0200 |
| parents | 5bf79bb3cf7e |
| children |
comparison
equal
deleted
inserted
replaced
| 3112:ed948c75e53e | 3113:8298b06e6603 |
|---|---|
| 4 | 4 |
| 5 local idle_timeout = module:get_option_number("c2s_idle_timeout", 300); | 5 local idle_timeout = module:get_option_number("c2s_idle_timeout", 300); |
| 6 local ping_timeout = module:get_option_number("c2s_ping_timeout", 30); | 6 local ping_timeout = module:get_option_number("c2s_ping_timeout", 30); |
| 7 | 7 |
| 8 function update_watchdog(data, session) | 8 function update_watchdog(data, session) |
| 9 session.idle_watchdog:reset(); | 9 if session.idle_watchdog then |
| 10 session.idle_pinged = nil; | 10 session.idle_watchdog:reset(); |
| 11 session.idle_pinged = nil; | |
| 12 end | |
| 11 return data; | 13 return data; |
| 12 end | 14 end |
| 13 | 15 |
| 14 function check_session(watchdog) | 16 function check_session(watchdog) |
| 15 local session = watchdog.session; | 17 local session = watchdog.session; |
