-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge ToolConfWatchers and separate from Toolbox #3821
Conversation
lib/galaxy/tools/toolbox/watcher.py
Outdated
t = threading.Thread(target=self.event_handler.on_any_event) | ||
t.daemon = True | ||
t.start() | ||
self.reload_callback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can reduce the indentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised that wasn't flagged by tox!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I'm more 🦅 than flake8 😆
Looks much cleaner, thanks @mvdbeek! |
This should avoid some complexities associated with managing threads. I would also like to eliminate the separate reload_tool_data_tables and reload_data_managers callbacks and do this when reloading the toolbox, but every tool data table reload triggers twice the download of http://igv.broadinstitute.org/genomes/genomes.txt, which each time takes 2 seconds.
c2e0615
to
c857388
Compare
lib/galaxy/tools/toolbox/watcher.py
Outdated
from galaxy.queue_worker import ( | ||
reload_data_managers, | ||
reload_toolbox, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing in galaxy.tools.toolbox
should depend on galaxy.queue_worker
IMO. The former module is meant to stand-alone from the app and models - hence the subclassing of ToolBox from AbstractToolBox and the inclusion on that module in galaxy-lib. Can you refactor this config watcher stuff into say galaxy.tools.watchers
or galaxy.webapps.galaxy.config_watchers
perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I think I've done that in 1a5e337.
This is ready for review now. |
|
||
|
||
class ConfigWatchers(object): | ||
"""Contains ToolConfWatcher, ToolWatcher and ToolDataWatcher objects.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this class does not contain a ToolWatcher
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I've made that change in f79fb90
061d214
to
2515d01
Compare
90bd7ed
to
63f1efd
Compare
Agreed with @nsoranzo - this is really nice! What a better separation of concerns - very crisp. 💯 |
This should avoid some complexities associated with managing threads.