backup chunk-size

This commit is contained in:
Anton Suhorukov 2023-03-09 15:34:47 +03:00
parent 9e6205a949
commit 92539449c4
4 changed files with 12 additions and 6 deletions

View File

@ -30,6 +30,7 @@ public class BackupSettings
{
public string UpgradesPath { get; set; }
public int Limit { get; set; }
public long ChunkSize { get; set; }
public ServiceConfigurationElement Service { get; set; }
public SchedulerConfigurationElement Scheduler { get; set; }
public CleanerConfigurationElement Cleaner { get; set; }

View File

@ -36,19 +36,22 @@ public class BackupWorker
private DistributedTaskQueue _progressQueue;
private int _limit;
private string _upgradesPath;
private readonly TempPath _tempPath;
private readonly TempPath _tempPath;
private readonly SetupInfo _setupInfo;
private readonly IServiceProvider _serviceProvider;
private readonly object _synchRoot = new object();
public BackupWorker(
IDistributedTaskQueueFactory queueFactory,
IServiceProvider serviceProvider,
TempPath tempPath)
TempPath tempPath,
SetupInfo setupInfo)
{
_serviceProvider = serviceProvider;
_progressQueue = queueFactory.CreateQueue(CUSTOM_DISTRIBUTED_TASK_QUEUE_NAME);
_tempPath = tempPath;
TempFolder = Path.Combine(_tempPath.GetTempPath(), "backup");
TempFolder = Path.Combine(_tempPath.GetTempPath(), "backup");
_setupInfo = setupInfo;
}
public void Start(BackupSettings settings)
@ -59,7 +62,8 @@ public class BackupWorker
}
_limit = settings.Limit;
_upgradesPath = settings.UpgradesPath;
_upgradesPath = settings.UpgradesPath;
_setupInfo.ChunkUploadSize = settings.ChunkSize;
}
public void Stop()

View File

@ -15,6 +15,7 @@
"Cleaner":
{
"Period":"00:15:00"
}
},
"ChunkSize": 20971520
}
}

View File

@ -61,7 +61,7 @@ public class SetupInfo
}
public string TeamlabSiteRedirect { get; private set; }
public long ChunkUploadSize { get; private set; }
public long ChunkUploadSize { get; set; }
public long ProviderMaxUploadSize { get; private set; }
public bool ThirdPartyAuthEnabled { get; private set; }
public string NoTenantRedirectURL { get; private set; }