commit/galaxy-central: natefoo: Decrease user disk usage when files are removed from disk by the cleanup_datasets.py.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/126c7f11415b/ changeset: 126c7f11415b user: natefoo date: 2011-08-22 22:19:49 summary: Decrease user disk usage when files are removed from disk by the cleanup_datasets.py. affected #: 1 file (473 bytes) --- a/scripts/cleanup_datasets/cleanup_datasets.py Mon Aug 22 16:07:23 2011 -0400 +++ b/scripts/cleanup_datasets/cleanup_datasets.py Mon Aug 22 16:19:49 2011 -0400 @@ -453,6 +453,13 @@ # Remove associated extra files from disk if they exist if dataset.extra_files_path and os.path.exists( dataset.extra_files_path ): shutil.rmtree( dataset.extra_files_path ) #we need to delete the directory and its contents; os.unlink would always fail on a directory + usage_users = [] + for hda in dataset.history_associations: + if not hda.purged and hda.history.user is not None and hda.history.user not in usage_users: + usage_users.append( hda.history.user ) + for user in usage_users: + user.total_disk_usage -= dataset.total_size + app.sa_session.add( user ) print "Purging dataset id", dataset.id dataset.purged = True app.sa_session.add( dataset ) Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket