Skip to content

Commit

Permalink
Keep chunked uploads outside file_store dir and delete chunked upload…
Browse files Browse the repository at this point in the history
… instances when finished successfully (#2594)
  • Loading branch information
hackdna committed Feb 16, 2018
1 parent ff11672 commit 8f01113
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions refinery/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import urlparse

from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage

import djcelery
import yaml
Expand Down Expand Up @@ -330,6 +331,8 @@ def get_setting(name, settings=local_settings, default=None):
}

CHUNKED_UPLOAD_ABSTRACT_MODEL = False
# keep chunked uploads outside the file_store directory
CHUNKED_UPLOAD_STORAGE_CLASS = FileSystemStorage

# === Refinery Settings ===

Expand Down
1 change: 1 addition & 0 deletions refinery/data_set_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ def on_completion(self, uploaded_file, request):
logger.error(
"Error moving uploaded file to user's import directory: %s",
exc)
chunked_upload.delete()

def get_response_data(self, chunked_upload, request):
message = "You have successfully uploaded {}".format(
Expand Down

0 comments on commit 8f01113

Please sign in to comment.