mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 18:07:22 +01:00
do not rely on "*" being present in configuration when picking file shard
This commit is contained in:
parent
c9030d933b
commit
810c6dbd45
1 changed files with 2 additions and 1 deletions
|
|
@ -101,7 +101,8 @@ public class ServerFilesController : ControllerBase
|
|||
}
|
||||
|
||||
var shard = selectedShards
|
||||
.OrderBy(s => s.Continents.Contains("*", StringComparer.Ordinal) ? 0 : 1)
|
||||
.OrderBy(s => !s.Continents.Any() ? 0 : 1)
|
||||
.ThenBy(s => s.Continents.Contains("*", StringComparer.Ordinal) ? 0 : 1)
|
||||
.ThenBy(g => Guid.NewGuid()).FirstOrDefault();
|
||||
|
||||
baseUrl = shard?.CdnFullUrl ?? _configuration.GetValue<Uri>(nameof(StaticFilesServerConfiguration.CdnFullUrl));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue