Merge branch 'main' into web-push
* main: (28 commits) Clean up the /scripts directory Prevent recursion when invoking AI Bump sqlite3 from 2.7.2 to 2.7.3 Port over Jeremy's fix for slow uploads .gitignore log files and portfolio's local storage Drop Current.account and just use Account.sole Use the utf8-patched mysql driver Call blob.preview for previewable attachments Make sure the image variants we use are preprocessed Add /user command Make sure it doesn't infer custom abbreviations when matching user names Script to load prod db in development Update Signup to use the queenbee_id for the tenant name Bump cache version Make sure it uses latest bundler to prevent error due to mismatch Invalidate cache Update ruby Update bundler to prevent error on lower version Update bundler to prevent error on lower version Resolve stages ...
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# see https://github.com/basecamp/haystack/pull/7862
|
||||
#
|
||||
module ActiveStorage
|
||||
mattr_accessor :service_urls_for_direct_uploads_expire_in, default: 48.hours
|
||||
end
|
||||
|
||||
module ActiveStorageBlobServiceUrlForDirectUploadExpiry
|
||||
# Override default expires_in to accommodate long upload URL expiry
|
||||
# without having to lengthen download URL expiry.
|
||||
#
|
||||
# Accounts for Cloudflare only proxying slow client uploads once they're
|
||||
# fully buffered, long after the URL expired.
|
||||
#
|
||||
# 48 hours covers a 10GB upload at 0.5Mbps.
|
||||
def service_url_for_direct_upload(expires_in: ActiveStorage.service_urls_for_direct_uploads_expire_in)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.on_load :active_storage_blob do
|
||||
prepend ::ActiveStorageBlobServiceUrlForDirectUploadExpiry
|
||||
end
|
||||
Reference in New Issue
Block a user