Bloom.WebLibraryIntegration.BookTransfer.WaitUntilS3DataIsOnServer C# (CSharp) Method

WaitUntilS3DataIsOnServer() private method

private WaitUntilS3DataIsOnServer ( string bucket, string bookPath ) : void
bucket string
bookPath string
return void
        internal void WaitUntilS3DataIsOnServer(string bucket, string bookPath)
        {
            var s3Id = S3BookId(BookMetaData.FromFolder(bookPath));
            var count = Directory.GetFiles(bookPath).Length;
            for (int i = 0; i < 30; i++)
            {
                var uploaded = _s3Client.GetBookFileCount(bucket, s3Id);
                if (uploaded >= count)
                    return;
                Thread.Sleep(100);
            }
            throw new ApplicationException("S3 is very slow today");
        }