changeset 4355:31afa4f314cc

mod_cloud_notify: Fix handling of push_queue smacks-hibernating while the push_queue had a timer running resulted in push not working for this session anymore.
author tmolitor <thilo@eightysoft.de>
date Sun, 17 Jan 2021 21:52:36 +0100
parents d61d7d30f38d
children ab2e15d3f1fa
files mod_cloud_notify/mod_cloud_notify.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_cloud_notify/mod_cloud_notify.lua	Sun Jan 17 18:11:19 2021 +0000
+++ b/mod_cloud_notify/mod_cloud_notify.lua	Sun Jan 17 21:52:36 2021 +0100
@@ -438,7 +438,7 @@
 		if not session.push_queue then session.push_queue = {}; end
 		local queue = session.push_queue;
 		queue[#queue+1] = st.clone(stanza);
-		if #queue == 1 then		-- first stanza --> start timer
+		if not session.awaiting_push_timer then		-- timer not already running --> start new timer
 			session.log("debug", "Invoking cloud handle_notify_request() for newly smacks queued stanza (in a moment)");
 			session.awaiting_push_timer = module:add_timer(1.0, function ()
 				session.log("debug", "Invoking cloud handle_notify_request() for newly smacks queued stanzas (now in timer)");