mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Decrease disk usage and actually remove datasets (if applicable) when purging a history.
This commit is contained in:
@@ -271,9 +271,12 @@ class HistoryController( BaseController, Sharable, UsesAnnotations, UsesItemRati
|
||||
n_deleted += 1
|
||||
if purge and trans.app.config.allow_user_dataset_purge:
|
||||
for hda in history.datasets:
|
||||
if trans.user:
|
||||
trans.user.total_disk_usage -= hda.quota_amount( trans.user )
|
||||
hda.purged = True
|
||||
trans.sa_session.add( hda )
|
||||
trans.log_event( "HDA id %s has been purged" % hda.id )
|
||||
trans.sa_session.flush()
|
||||
if hda.dataset.user_can_purge:
|
||||
try:
|
||||
hda.dataset.full_delete()
|
||||
@@ -1207,4 +1210,4 @@ class HistoryController( BaseController, Sharable, UsesAnnotations, UsesItemRati
|
||||
|
||||
def get_item( self, trans, id ):
|
||||
return self.get_history( trans, id )
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user