expire download links

This commit is contained in:
Pete Matsyburka
2025-08-31 16:40:18 +03:00
parent 02c7cdcd97
commit c4a693846e
26 changed files with 184 additions and 78 deletions
+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