From dd192ed572c8bf71e2551d5cbb1b7d29d174aa48 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Fri, 27 Nov 2020 09:38:55 +0100 Subject: [PATCH] Fixes #3304: Sessions::Node don't do any work if ZAMMAD_SESSION_JOBS_CONCURRENT was higher and got lowered. --- lib/sessions.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/sessions.rb b/lib/sessions.rb index 0845c4f3b..164d89b93 100644 --- a/lib/sessions.rb +++ b/lib/sessions.rb @@ -621,6 +621,12 @@ delete spool messages # dispatch sessions if node_id.blank? && ENV['ZAMMAD_SESSION_JOBS_CONCURRENT'].to_i.positive? + previous_nodes_sessions = Sessions::Node.stats + if previous_nodes_sessions.present? + log('info', "Cleaning up previous Sessions::Node sessions: #{previous_nodes_sessions}") + Sessions::Node.cleanup + end + dispatcher_pid = Process.pid node_count = ENV['ZAMMAD_SESSION_JOBS_CONCURRENT'].to_i node_pids = [] @@ -649,7 +655,7 @@ delete spool messages raise SignalException, 'SIGTERM' end - # displatch client_ids to nodes + # dispatch client_ids to nodes loop do # nodes @@ -661,7 +667,7 @@ delete spool messages # ask nodes for nodes next if nodes_stats[client_id] - # assigne to node + # assign to node Sessions::Node.session_assigne(client_id) sleep 1 end