mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Avoid making HTTP requests to generate signed URLs for GCS objects
This commit is contained in:
parent
f27a45af46
commit
cffa32f95d
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ module ActiveStorage
|
|||
def delete(key)
|
||||
instrument :delete, key do
|
||||
begin
|
||||
file_for(key).try(:delete)
|
||||
file_for(key).delete
|
||||
rescue Google::Cloud::NotFoundError
|
||||
# Ignore files already deleted
|
||||
end
|
||||
|
@ -45,7 +45,7 @@ module ActiveStorage
|
|||
|
||||
def exist?(key)
|
||||
instrument :exist, key do |payload|
|
||||
answer = file_for(key).present?
|
||||
answer = file_for(key).exists?
|
||||
payload[:exist] = answer
|
||||
answer
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ module ActiveStorage
|
|||
|
||||
private
|
||||
def file_for(key)
|
||||
bucket.file(key)
|
||||
bucket.file(key, skip_lookup: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue