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");
}