Allow file shards to signal main server directly

This commit is contained in:
Loporrit
2024-09-06 08:02:31 +00:00
parent 524e412c28
commit 2090c65bf1
3 changed files with 38 additions and 1 deletions

View File

@@ -25,7 +25,10 @@ public class ShardClientReadyMessageService : IClientReadyMessageService
{
_ = Task.Run(async () =>
{
var mainUrl = _configurationService.GetValue<Uri>(nameof(StaticFilesServerConfiguration.MainFileServerAddress));
var mainUrlConfigKey = _configurationService.GetValue<bool>(nameof(StaticFilesServerConfiguration.NotifyMainServerDirectly))
? nameof(StaticFilesServerConfiguration.MainServerAddress)
: nameof(StaticFilesServerConfiguration.MainFileServerAddress);
var mainUrl = _configurationService.GetValue<Uri>(mainUrlConfigKey);
var path = MareFiles.MainSendReadyFullPath(mainUrl, uid, requestId);
using HttpRequestMessage msg = new()
{