From 6b9bad6cddf5060699774eedd4c560c405e7bcc0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 30 Oct 2023 20:51:23 -0600 Subject: [PATCH] Set a default range request chunk size Fixes https://github.com/turt2live/matrix-media-repo/issues/485 --- common/config/conf_domain.go | 5 +++-- common/config/conf_main.go | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/config/conf_domain.go b/common/config/conf_domain.go index ac174720..f7784f43 100644 --- a/common/config/conf_domain.go +++ b/common/config/conf_domain.go @@ -18,8 +18,9 @@ func NewDefaultDomainConfig() DomainRepoConfig { AdminApiKind: "matrix", }, Downloads: DownloadsConfig{ - MaxSizeBytes: 104857600, // 100mb - FailureCacheMinutes: 15, + MaxSizeBytes: 104857600, // 100mb + FailureCacheMinutes: 15, + DefaultRangeChunkSizeBytes: 10485760, // 10mb }, UrlPreviews: UrlPreviewsConfig{ Enabled: true, diff --git a/common/config/conf_main.go b/common/config/conf_main.go index 25ba7079..7e8729b5 100644 --- a/common/config/conf_main.go +++ b/common/config/conf_main.go @@ -44,8 +44,9 @@ func NewDefaultMainConfig() MainRepoConfig { Admins: []string{}, Downloads: MainDownloadsConfig{ DownloadsConfig: DownloadsConfig{ - MaxSizeBytes: 104857600, // 100mb - FailureCacheMinutes: 15, + MaxSizeBytes: 104857600, // 100mb + FailureCacheMinutes: 15, + DefaultRangeChunkSizeBytes: 10485760, // 10mb }, NumWorkers: 10, ExpireDays: 0,