Comparison

mod_s2s_keepalive/mod_s2s_keepalive.lua @ 3723:427879b46061

mod_s2s_keepalive: Remove support for obsolete Prosody 0.8
author Kim Alvefur <zash@zash.se>
date Fri, 01 Nov 2019 14:08:10 +0100
parent 1264:2db2c03dfb95
child 3764:07a1faa24261
comparison
equal deleted inserted replaced
3722:bdbbf11eac0c 3723:427879b46061
24 end 24 end
25 end 25 end
26 return keepalive_interval; 26 return keepalive_interval;
27 end 27 end
28 28
29 if module.add_timer then -- 0.9 29 module:add_timer(keepalive_interval, send_pings);
30 module:add_timer(keepalive_interval, send_pings);
31 else -- 0.8
32 local timer = require "util.timer";
33 local unloaded;
34 timer.add_task(keepalive_interval, function()
35 if not unloaded then
36 return send_pings()
37 end
38 end);
39 function module.unload()
40 unloaded = true
41 end
42 end