From fb69afae28c434f35860ccaa4591e95fe3acfe91 Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Mon, 7 Nov 2016 11:29:10 +0000 Subject: [PATCH] Update ToolPanelElements instance locally in addition to Galaxy's IPC call via send_control_task. --- lib/galaxy/tools/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index b053f530b5b2..f11d1d5d5c39 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -9,7 +9,6 @@ import re import tarfile import tempfile -import time import threading import urllib from datetime import datetime @@ -120,12 +119,14 @@ def handle_reload_toolbox(self): reload_toolbox(self.app) def handle_panel_update(self, section_dict): - send_control_task(self.app, 'create_panel_section', noop_self=False, kwargs=section_dict) - max_wait = 10 - i = 0 - while not section_dict['id'] in self._tool_panel and i < max_wait: - i += 1 - time.sleep(1) + """ + Sends a panel update to all threads/processes. + """ + send_control_task(self.app, 'create_panel_section', kwargs=section_dict) + # The following local call to self.create_section should be unnecessary + # but occasionally the local ToolPanelElements instance appears to not + # get updated. + self.create_section(section_dict) def has_reloaded(self, other_toolbox): return self._reload_count != other_toolbox._reload_count