extend torrent webseed lifetime to an hour
This commit is contained in:
parent
7ac3b05a1d
commit
e18dacd26b
2 changed files with 3 additions and 1 deletions
|
@ -289,6 +289,7 @@ class DefaultConfig(object):
|
|||
BITTORRENT_PIECE_SIZE = 512 * 1024
|
||||
BITTORRENT_ANNOUNCE_URL = 'https://localhost:6881/announce'
|
||||
BITTORRENT_FILENAME_PEPPER = '3ae93fef-c30a-427e-9ba0-eea0fd710419'
|
||||
BITTORRENT_WEBSEED_LIFETIME = 3600
|
||||
|
||||
# "Secret" key for generating encrypted paging tokens. Only needed to be secret to
|
||||
# hide the ID range for production (in which this value is overridden). Should *not*
|
||||
|
|
|
@ -137,7 +137,8 @@ def _torrent_for_storage(storage_ref, is_public):
|
|||
|
||||
# Lookup the webseed path for the storage.
|
||||
path = model.storage.get_layer_path(storage_ref)
|
||||
webseed = storage.get_direct_download_url(storage_ref.locations, path)
|
||||
webseed = storage.get_direct_download_url(storage_ref.locations, path,
|
||||
expires_in=app.config['BITTORRENT_WEBSEED_LIFETIME'])
|
||||
if webseed is None:
|
||||
# We cannot support webseeds for storages that cannot provide direct downloads.
|
||||
abort(make_response('Storage engine does not support seeding.', 501))
|
||||
|
|
Reference in a new issue