mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merged in dan/galaxy-central-prs (pull request #659)
In API, when removing or refreshing a data table, send the reload signal to the worker queue. Change return values of reload and delete to be the new table contents, instead of the only-internally-useful 'version'.
This commit is contained in:
@@ -5,6 +5,7 @@ from galaxy import web
|
||||
from galaxy.web import _future_expose_api as expose_api
|
||||
from galaxy.web import _future_expose_api_raw as expose_api_raw
|
||||
from galaxy.web.base.controller import BaseAPIController
|
||||
import galaxy.queue_worker
|
||||
|
||||
|
||||
class ToolData( BaseAPIController ):
|
||||
@@ -36,7 +37,11 @@ class ToolData( BaseAPIController ):
|
||||
"""
|
||||
decoded_tool_data_id = id
|
||||
data_table = trans.app.tool_data_tables.data_tables.get(decoded_tool_data_id)
|
||||
return data_table.reload_from_files()
|
||||
data_table.reload_from_files()
|
||||
galaxy.queue_worker.send_control_task( trans, 'reload_tool_data_tables',
|
||||
noop_self=True,
|
||||
kwargs={'table_name': decoded_tool_data_id} )
|
||||
return self._data_table( decoded_tool_data_id ).to_dict( view='element' )
|
||||
|
||||
|
||||
@web.require_admin
|
||||
@@ -78,7 +83,11 @@ class ToolData( BaseAPIController ):
|
||||
trans.response.status = 400
|
||||
return "Invalid data table item ( %s ) specified. Wrong number of columns (%s given, %s required)." % ( str( values ), str(len(split_values)), str(len(data_table.get_column_name_list())))
|
||||
|
||||
return data_table.remove_entry(split_values)
|
||||
data_table.remove_entry(split_values)
|
||||
galaxy.queue_worker.send_control_task( trans, 'reload_tool_data_tables',
|
||||
noop_self=True,
|
||||
kwargs={'table_name': decoded_tool_data_id} )
|
||||
return self._data_table( decoded_tool_data_id ).to_dict( view='element' )
|
||||
|
||||
@web.require_admin
|
||||
@expose_api
|
||||
|
||||
Reference in New Issue
Block a user