protected override void DoJob() { foreach (var file in directoryFiles) { var filePath = file.Substring(mappedPath.TrimEnd('/').Length); StaticUploader.UploadFileAsync(Path.Combine(relativePath, filePath), file, (res) => StepDone()).Wait(); } }
protected override async Task DoJobAsync() { var tasks = new List <Task>(); foreach (var file in directoryFiles) { var filePath = file.Substring(mappedPath.TrimEnd('/').Length); tasks.Add(StaticUploader.UploadFileAsync(Path.Combine(relativePath, filePath), file, (res) => StepDone())); } await Task.WhenAll(tasks); }