Prevent reloading when data table is being modified

Fixes https://github.com/galaxyproject/galaxy/issues/4783.
This commit is contained in:
mvdbeek
2018-01-18 15:05:47 +01:00
parent a81f3e4e8c
commit d94148ff79
2 changed files with 8 additions and 4 deletions
+4 -4
View File
@@ -317,10 +317,10 @@ class DataManager(object):
self.process_move(data_table_name, name, output_ref_values[name].extra_files_path, **data_table_value)
data_table_value[name] = self.process_value_translation(data_table_name, name, **data_table_value)
data_table.add_entry(data_table_value, persist=True, entry_source=self)
send_control_task(self.data_managers.app,
'reload_tool_data_tables',
noop_self=True,
kwargs={'table_name': data_table_name})
send_control_task(self.data_managers.app,
'reload_tool_data_tables',
noop_self=True,
kwargs={'table_name': data_table_name})
if self.undeclared_tables and data_tables_dict:
# We handle the data move, by just moving all the data out of the extra files path
# moving a directory and the target already exists, we move the contents instead
+4
View File
@@ -252,6 +252,10 @@ class LocFileEventHandler(FileSystemEventHandler):
if self.loc_watcher.path_hash.get(path) == cur_hash:
return
else:
time.sleep(0.5)
if cur_hash != md5_hash_file(path):
# We're still modifying the file, it'll be picked up later
return
self.loc_watcher.path_hash[path] = cur_hash
self.loc_watcher.tool_data_tables.reload_tables(path=path)