expire download links

This commit is contained in:
Pete Matsyburka committed 2025-09-01 11:59:02 +03:00
1 parent 02c7cdcd97
commit c4a693846e
26 files changed
+184 -78

No files matched your search

+9
View File
@@ -1,6 +1,8 @@
# frozen_string_literal: true
module Accounts
LINK_EXPIRES_AT = 40.minutes
module_function
def create_duplicate(account)
@@ -185,4 +187,11 @@ module Accounts
rescue TZInfo::InvalidTimezoneIdentifier
'UTC'
end
def link_expires_at(account)
return if AccountConfig.find_or_initialize_by(account: account,
key: AccountConfig::DOWNLOAD_LINKS_EXPIRE_KEY).value == false
LINK_EXPIRES_AT.from_now
end
end