fix GetFilesToProcess in migration

This commit is contained in:
Anton Suhorukov 2022-12-27 14:57:20 +03:00
parent bae96cbdf7
commit e8ed2bcd89

View File

@ -42,7 +42,8 @@ public class MigrationCreator
private string _pathToSave;
private string _userName;
private string _toRegion;
private int _tenant;
private int _tenant;
private readonly object _locker = new object();
private readonly int _limit = 1000;
private readonly List<ModuleName> _namesModules = new List<ModuleName>()
{
@ -290,7 +291,11 @@ public class MigrationCreator
.Select(path => new BackupFileInfo(string.Empty, module, path, _tenant))
.ToListAsync();
list.AddRange(files);
lock (_locker)
{
list.AddRange(files);
}
if (files.Any())
{
Console.WriteLine($"file {dbFile.Id} found");