Skip to content

Commit

Permalink
fix: dont retrieve from store until accessing file
Browse files Browse the repository at this point in the history
  • Loading branch information
Amnesthesia committed Sep 6, 2023
1 parent d973607 commit 23c85c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/carrierwave/uploader/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def store!(new_file=nil)
cache_storage.delete_dir!(cache_path(nil))
end
@file = new_file
@identifier = storage.try(:identifier)
@identifier = storage.identifier
@cache_id = @deduplication_index = nil
@staged = false
end
Expand Down Expand Up @@ -120,7 +120,7 @@ def file
#
def retrieve_from_store!(file_identifier)
retrieval_retry_count ||= 0
# return if retrieval_retry_count > download_retry_count
return if retrieval_retry_count > download_retry_count
retrieval_retry_count += 1
with_callbacks(:retrieve_from_store, file_identifier) do
# We can't retrieve the file if we have no identifier
Expand Down

0 comments on commit 23c85c7

Please sign in to comment.