Skip to content

Commit

Permalink
Small optimizations to running tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Nov 24, 2015
1 parent 77166a7 commit 32728e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/galaxy/model/__init__.py
Expand Up @@ -215,7 +215,8 @@ def set_disk_usage( self, bytes ):
total_disk_usage = property( get_disk_usage, set_disk_usage )

def adjust_total_disk_usage( self, amount ):
self.disk_usage = func.coalesce(self.table.c.disk_usage, 0) + amount
if amount != 0:
self.disk_usage = func.coalesce(self.table.c.disk_usage, 0) + amount

@property
def nice_total_disk_usage( self ):
Expand Down
6 changes: 5 additions & 1 deletion lib/galaxy/tools/actions/__init__.py
Expand Up @@ -289,6 +289,8 @@ def handle_output( name, output ):
output_action_params.update( incoming )
output.actions.apply_action( data, output_action_params )
# Store all changes to database
# Updates at least state, blurb, and name. Does a query before
# hand I don't know why...
trans.sa_session.flush()
return data

Expand Down Expand Up @@ -377,7 +379,9 @@ def handle_output( name, output ):
if name not in child_dataset_names and name not in incoming: # don't add children; or already existing datasets, i.e. async created
data = out_data[ name ]
if set_output_history:
history.add_dataset( data, set_hid=set_output_hid )
# Set HID and add to history.
# This is brand new and certainly empty so don't worry about quota.
history.add_dataset( data, set_hid=set_output_hid, quota=False )
trans.sa_session.add( data )
trans.sa_session.flush()
# Add all the children to their parents
Expand Down

0 comments on commit 32728e2

Please sign in to comment.