Skip to content

Commit

Permalink
Merge pull request #3130 from mvdbeek/fix_invalid_section_key
Browse files Browse the repository at this point in the history
Update ToolPanelElements instance locally
  • Loading branch information
dannon committed Nov 16, 2016
2 parents 2f08dd7 + fb69afa commit ac5b7ef
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -9,7 +9,6 @@
import re
import tarfile
import tempfile
import time
import threading
import urllib
from datetime import datetime
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ac5b7ef

Please sign in to comment.